id stringlengths 36 36 | text stringlengths 1 1.25M |
|---|---|
96bdc1f1-1e0e-4102-9373-7d17a9a07c7b | private int getFloatValue(Node n)
{
int ret = -1;
float f = -1.0f;
for (int i = 0;i < n.getChildNodes().getLength();i++)
{
Node a = n.getChildNodes().item(i);
// System.out.println("Looking at child " + i + ", node name " + a.getNodeName() + ", node value " + a.getNodeValue()+", text content "+a.getTextC... |
a0b9cfcf-5c09-45c8-837d-68260a4b0062 | public void printWeatherPoint()
{
// This prints out all data stored in a weather point.
System.out.println("Printing weather point.");
System.out.println("\tMax Temperature: " + maxTemp + " degrees");
System.out.println("\tMin Temperature: " + minTemp + " degrees");
System.out.println("\tDew Point Temperat... |
1233e330-0c84-42db-aef9-44179d58f98b | public VoltDbConnection(String tableName)
{
this.tableName = tableName;
/* Load driver and set up database connection */
try
{
Class.forName(driver);
conn = DriverManager.getConnection(url);
}
catch (SQLException e)
{
System.err.println("Error creating JDBC connection");
}
catch (ClassNotFo... |
7df61da5-9ec6-4324-813e-0c0947b1b29f | public void addRecord(WeatherPoint pt)
{
//Pre-redesign INSERT statement
// String sql = "INSERT INTO " + tableName + "(maxTemp, mintemp, dewPointTemp, heatIndexTemp, windChillTemp, rainAmount, snowAmount, probabilityOfPrecipitation, outlookPercent, tornadoPercent, hailPercent, damagingThunderstormWindPercent, extr... |
d459431e-f51d-4b74-9ce9-757285782c1a | public LinkedList <WeatherPoint> getAllWeatherPoints()
{
ResultSet res = null;
LinkedList <WeatherPoint> wps = new LinkedList<>();
String sql = "SELECT * FROM weatherpoints";
/* Get result set */
try
{
Statement query = conn.createStatement();
res = query.executeQuery(sql);
}
catch (SQLException... |
135ce3b7-b307-4da5-b194-395555f47ebe | public LinkedList <WeatherPoint> getWeatherPointsWhere(String where)
{
ResultSet res = null;
LinkedList <WeatherPoint> wps = new LinkedList<>();
String sql = "SELECT * FROM weatherpoints WHERE " + where;
/* Get result set */
try
{
Statement query = conn.createStatement();
res = query.executeQuery(sq... |
faa14569-c819-43a5-9568-f692550b15bf | private WeatherPoint resultToWeatherPoint(ResultSet res)
{
WeatherPoint wp = new WeatherPoint();
try
{
wp.maxTemp = res.getInt("maxTemp");
wp.minTemp = res.getInt("minTemp");
wp.dewPoint = res.getInt("dewPoint");
wp.precipitationProbability12hour = res.getInt("precipitationProbability12hour");
wp... |
85ec3dda-648e-4a83-9665-41ba27cb8740 | public boolean isVisible() { return isVisible; } |
ba012152-5fa3-481e-873a-0b8262c9ff39 | public void setVisible( boolean flag ) { isVisible = flag; } |
d20de280-f553-48c3-a17a-6c430e1f548e | public boolean isMouseOverWidget() { return false; } |
85c91bb4-66f0-4aba-9222-f1e25bf04fbf | public int pressEvent( int x, int y ) { return S_EVENT_NOT_CONSUMED; } |
37469475-b5c2-4a28-aec0-6fac3821ef0b | public int releaseEvent( int x, int y ) { return S_EVENT_NOT_CONSUMED; } |
66597f7c-7e64-4c16-b322-3ce76b333fe2 | public int moveEvent( int x, int y ) { return S_EVENT_NOT_CONSUMED; } |
83a9612b-c935-4639-a94b-ecdadfb05a68 | public int dragEvent( int x, int y ) { return S_EVENT_NOT_CONSUMED; } |
0430e137-da9b-4fc5-ac6f-9ba9ce57fb3a | public void draw(
GL gl, GLUT glut,
int window_width_in_pixels,
int window_height_in_pixels
) {
} |
692d127d-460d-4db2-99c8-6fd7a963e445 | public RadialMenuWidget() {
for (int i = 0; i <= N; ++i) {
label[i] = new String("");
isEnabled[i] = true;
// Give every item a distinct ID.
itemID[i] = i;
}
} |
0c4e1057-92dc-4d8c-8326-9cc31e1de03d | public void setItemLabelAndID( int index, String s, int id ) {
if ( 0 <= index && index <= N ) {
label[index] = s;
itemID[index] = id;
}
} |
98591024-3b45-42ea-b927-736b249dd3c5 | public void setItemLabel( int index, String s ) {
if ( 0 <= index && index <= N ) {
label[index] = s;
}
} |
6dd7d0df-58a1-46c2-9cf7-d29207d7949a | public int getItemID( int index ) {
if ( 0 <= index && index <= N ) {
return itemID[index];
}
return -1;
} |
c35a5e5f-e4dd-42a8-b920-7df0ac8c1d94 | private boolean isItemHilited( int index ) {
assert 0 <= index && index <= N;
return itemID[ index ] == itemID[ selectedItem ];
} |
9c4572e7-8d94-4ac2-b27e-26d4e4bf18b0 | public int getSelection() { return selectedItem; } |
c5d7398a-1bfd-489f-84da-ce0341373881 | public int pressEvent( int x, int y ) {
x0 = mouse_x = x;
y0 = mouse_y = y;
selectedItem = CENTRAL_ITEM;
isVisible = true;
return S_REDRAW;
} |
df0fc8ff-ae2b-4cd4-956b-3e156a06c7fd | public int releaseEvent( int x, int y ) {
if ( isVisible ) {
isVisible = false;
return S_REDRAW;
}
return S_EVENT_NOT_CONSUMED;
} |
7256b3af-382b-4259-8106-3363f88b83ae | public int moveEvent( int x, int y ) {
// make the center of the menu follow the cursor
x0 = mouse_x = x;
y0 = mouse_y = y;
return S_REDRAW;
} |
5d43bfd5-7eff-49e5-adb0-8354a5bbf87e | public int dragEvent( int x, int y ) {
if ( ! isVisible )
return S_EVENT_NOT_CONSUMED;
mouse_x = x;
mouse_y = y;
int dx = mouse_x - x0;
int dy = mouse_y - y0;
float radius = (float)Math.sqrt( dx*dx + dy*dy );
int newlySelectedItem = CENTRAL_ITEM;
if ( radius > radiusOfNeutralZone ) {
float thet... |
794719a2-2616-4d97-904a-7c211b34974d | public void draw(
GL gl, GLUT glut,
int window_width_in_pixels,
int window_height_in_pixels
) {
if ( ! isVisible )
return;
gl.glPushAttrib(GL.GL_COLOR_BUFFER_BIT | GL.GL_CURRENT_BIT | GL.GL_ENABLE_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glDisable(GL.GL_LIGHTING);
gl.glDisable(GL.GL_DEPTH_TEST);
gl.glDept... |
3df1320b-f614-4828-92e7-8ac9f730a473 | public Point3D() {
p[0] = p[1] = p[2] = 0;
} |
9ee37aaf-4fe0-406d-b9c2-c632e8c6fcbf | public Point3D( float x, float y, float z ) {
p[0] = x;
p[1] = y;
p[2] = z;
} |
aa6b4973-980b-45b7-b278-b14df386d75c | public Point3D( Vector3D V ) {
p[0] = V.v[0];
p[1] = V.v[1];
p[2] = V.v[2];
} |
a46f3bb3-5ebd-45ea-9b03-c40e46f71383 | public void copy( Point3D P ) {
p[0] = P.p[0];
p[1] = P.p[1];
p[2] = P.p[2];
} |
01906fb3-724f-479b-8382-ed4302c554a6 | public float x() { return p[0]; } |
5620045d-f2eb-4241-8701-24bc72105d2a | public float y() { return p[1]; } |
df1707e5-21ee-4890-b097-5aa557400cef | public float z() { return p[2]; } |
f7ee505d-cf4a-429e-a14c-c1aebb16e9b3 | public float [] get() { return p; } |
dc64b808-63b2-4d35-a61a-c23d9ef40651 | static public Vector3D diff( Point3D a, Point3D b ) {
return new Vector3D( a.x()-b.x(), a.y()-b.y(), a.z()-b.z() );
} |
09092659-b0b0-436e-9e7c-482681a635df | static public Point3D sum( Point3D a, Vector3D b ) {
return new Point3D( a.x()+b.x(), a.y()+b.y(), a.z()+b.z() );
} |
ee687e79-0936-4ec2-a4d1-29ecf76350c0 | static public Point3D diff( Point3D a, Vector3D b ) {
return new Point3D( a.x()-b.x(), a.y()-b.y(), a.z()-b.z() );
} |
b963541c-65ba-4dd0-bd81-eb3e2bd9e860 | static Point3D average( Point3D a, Point3D b ) {
// return new Point3D( Vector3D.mult( Vector3D.sum( new Vector3D(a), new Vector3D(b) ), 0.5f ) );
return new Point3D( (a.x()+b.x())*0.5f, (a.y()+b.y())*0.5f, (a.z()+b.z())*0.5f );
} |
98c8a78d-a23b-4921-967f-93975b9546b4 | public ColoredBox(
AlignedBox3D alignedBox3D,
float red, float green, float blue, float alpha
) {
box = new AlignedBox3D(
alignedBox3D.getMin(),
alignedBox3D.getMax()
);
r = red;
g = green;
b = blue;
a = alpha;
} |
fca9fe7e-d41d-46a4-82cc-812b6f2d7b8a | public Scene() {
} |
1d119521-c055-428b-b0d0-d2957bddb36d | public AlignedBox3D getBoundingBoxOfScene() {
if ( isBoundingBoxOfSceneDirty ) {
boundingBoxOfScene.clear();
for ( int i = 0; i < coloredBoxes.size(); ++i ) {
boundingBoxOfScene.bound( coloredBoxes.elementAt(i).box );
}
isBoundingBoxOfSceneDirty = false;
}
return boundingBoxOfScene;
} |
9b8fd40b-e623-48e7-bec3-279d9ecea90e | public void addColoredBox(
AlignedBox3D box,
float red, float green, float blue,
float alpha
) {
ColoredBox cb = new ColoredBox( box, red, green, blue, alpha );
coloredBoxes.addElement( cb );
isBoundingBoxOfSceneDirty = true;
} |
c2a1e9b0-30c6-4985-b851-af2468abb7b1 | public int getIndexOfIntersectedBox(
Ray3D ray, // input
Point3D intersectionPoint, // output
Vector3D normalAtIntersection // output
) {
boolean intersectionDetected = false;
int indexOfIntersectedBox = -1;
float distanceToIntersection = 0;
// candidate intersection
Point3D candidatePoint = new Point... |
9dc6093d-af61-432d-a906-c12f4c97becc | public AlignedBox3D getBox( int index ) {
if ( 0 <= index && index < coloredBoxes.size() )
return coloredBoxes.elementAt(index).box;
return null;
} |
8bdb008c-e449-4692-8ddb-296125a9fda6 | public boolean getSelectionStateOfBox( int index ) {
if ( 0 <= index && index < coloredBoxes.size() )
return coloredBoxes.elementAt(index).isSelected;
return false;
} |
6fe6616f-db5e-4cd8-95e7-8ea3a16fea05 | public void deselectBoxes(){
for(int i = 0; i < coloredBoxes.size(); i++){
setSelectionStateOfBox(i, false);
}
} |
c99dc466-0118-4b06-bc01-f26907e524a3 | public void setSelectionStateOfBox( int index, boolean state ) {
if ( 0 <= index && index < coloredBoxes.size() )
coloredBoxes.elementAt(index).isSelected = state;
} |
18add37c-861f-4a74-8b7a-788ae27a9bc0 | public void toggleSelectionStateOfBox( int index ) {
if ( 0 <= index && index < coloredBoxes.size() ) {
ColoredBox cb = coloredBoxes.elementAt(index);
cb.isSelected = ! cb.isSelected;
}
} |
b01bbcb5-c1e9-47ab-b2a1-591698b33d32 | public void setColorOfBox( int index, float r, float g, float b, float a ) {
if ( 0 <= index && index < coloredBoxes.size() ) {
ColoredBox cb = coloredBoxes.elementAt(index);
cb.r = r;
cb.g = g;
cb.b = b;
cb.a = a;
boolean ok = true;
}
} |
341a1447-2c6c-4bae-9457-e0a588a7f850 | public void translateBox( int index, Vector3D translation ) {
if ( 0 <= index && index < coloredBoxes.size() ) {
ColoredBox cb = coloredBoxes.elementAt(index);
AlignedBox3D oldBox = cb.box;
cb.box = new AlignedBox3D(
Point3D.sum( oldBox.getMin(), translation ),
Point3D.sum( oldBox.getMax(), translati... |
187c9685-1dde-4886-aea6-241fd9d23f25 | public void resizeBox(
int indexOfBox, int indexOfCornerToResize, Vector3D translation
) {
if ( 0 <= indexOfBox && indexOfBox < coloredBoxes.size() ) {
ColoredBox cb = coloredBoxes.elementAt(indexOfBox);
AlignedBox3D oldBox = cb.box;
cb.box = new AlignedBox3D();
// One corner of the new box will be th... |
44e4e997-04ba-4175-80f7-54ef47c417f7 | public ArrayList<ColoredBox> getSelectedBoxes(){
ArrayList<ColoredBox> boxes = new ArrayList<ColoredBox>();
for ( int i = 0; i < coloredBoxes.size(); ++i ) {
ColoredBox cb = coloredBoxes.elementAt(i);
if ( cb.isSelected ){
boxes.add(cb);
}
}
return boxes;
} |
e0e7747e-748b-4fb0-84c2-77746999c661 | public void deleteBox( int index ) {
if ( 0 <= index && index < coloredBoxes.size() ) {
coloredBoxes.removeElementAt( index );
isBoundingBoxOfSceneDirty = true;
}
} |
50e436a4-33cc-43e9-95c8-4647ade78771 | public void deleteAllBoxes() {
coloredBoxes.removeAllElements();
isBoundingBoxOfSceneDirty = true;
} |
4a189b1c-4d14-4a17-af04-6e8461f88e68 | static public void drawBox(
GL gl,
AlignedBox3D box,
boolean expand,
boolean drawAsWireframe,
boolean cornersOnly
) {
if ( expand ) {
float diagonal = box.getDiagonal().length();
diagonal /= 20;
Vector3D v = new Vector3D( diagonal, diagonal, diagonal );
box = new AlignedBox3D( Point3D.diff(box.... |
ab4d9397-0f0f-4a31-8351-20f55ade5235 | public void drawScene(
GL gl,
int indexOfHilitedBox, // -1 for none
boolean useAlphaBlending,
boolean useWireFrame
) {
if ( useAlphaBlending ) {
gl.glDisable(GL.GL_DEPTH_TEST);
gl.glDepthMask(false);
gl.glBlendFunc( GL.GL_SRC_ALPHA, GL.GL_ONE );
gl.glEnable( GL.GL_BLEND );
}
for ( int i = 0; ... |
3f56b711-91da-4572-a563-f811bcc7e370 | public void drawBoundingBoxOfScene( GL gl ) {
AlignedBox3D box = getBoundingBoxOfScene();
if ( ! box.isEmpty() )
drawBox( gl, box, false, true, false );
} |
90721df3-0c4d-4082-b559-ed8f1bbcac75 | public SceneViewer( GLCapabilities caps, SimpleModeller sm ) {
super( caps );
this.sm = sm;
addGLEventListener(this);
addMouseListener( this );
addMouseMotionListener( this );
radialMenu.setItemLabelAndID( RadialMenuWidget.CENTRAL_ITEM, "", COMMAND_CREATE_BOX );
radialMenu.setItemLabelAndID( 1, "... |
e0833a24-3d30-4fba-a5c5-6a57acd0c62b | public Dimension getPreferredSize() {
return new Dimension( 512, 512 );
} |
fd4151a2-c58c-43d5-acf8-14e3f9e4ca43 | float clamp( float x, float min, float max ) {
if ( x < min ) return min;
if ( x > max ) return max;
return x;
} |
526cbcfe-7ce6-4920-8827-c756883ec22b | public void createNewBox() {
Vector3D halfDiagonalOfNewBox = new Vector3D(
ColoredBox.DEFAULT_SIZE*0.5f,
ColoredBox.DEFAULT_SIZE*0.5f,
ColoredBox.DEFAULT_SIZE*0.5f
);
if ( indexOfSelectedBox >= 0 ) {
ColoredBox cb = scene.coloredBoxes.elementAt(indexOfSelectedBox);
cb.isSelected = true;
Point3D ... |
a4fb2574-5caf-4858-9b8c-371227d4d169 | public void setColorOfSelection( float r, float g, float b, float a ) {
if ( scene.coloredBoxes.size() > 0 ) {
for(int i = 0; i < scene.coloredBoxes.size(); i++){
if(scene.coloredBoxes.get(i).isSelected){
scene.setColorOfBox( i, r, g, b, a );
}
}
}
} |
5d6df0a4-c487-4ed2-9f57-fba5755b454d | public void showColorPanel(boolean isVisible){
ArrayList<ColoredBox> boxes = scene.getSelectedBoxes();
if(boxes.size() > 0){
sm.getRedText().setText((int)(boxes.get(0).r * 256) + "");
sm.getGreenText().setText((int)(boxes.get(0).g * 256) + "");
sm.getBlueText().setText((int)(boxes.get(0).b * 256) + "");
... |
fdedc5bd-5ad8-4441-be37-eb40025b3818 | public void changeColor(){
boolean ok = true;
float red = 0;
float green = 0;
float blue = 0;
float alpha = 0;
try{
red = Float.parseFloat(sm.getRedText().getText().trim()) / 256;
green = Float.parseFloat(sm.getGreenText().getText().trim()) / 256;
blue = Float.parseFloat(sm.getBlueText().getText().... |
d7426340-d635-4b43-bc7d-91fe169e27a9 | public void deleteSelection() {
ArrayList<ColoredBox> boxes = new ArrayList<ColoredBox>();
for(int i = 0; i < scene.coloredBoxes.size(); i++){
boxes.add(((Vector<ColoredBox>)scene.coloredBoxes.clone()).get(i));
}
for(int i = boxes.size() - 1; i >= 0; i--){
if(boxes.get(i).isSelected){
scene.deleteB... |
ec49c5b0-f1a8-4048-a79c-83bd480efd9d | public void deleteAll() {
scene.deleteAllBoxes();
indexOfSelectedBox = -1;
indexOfHilitedBox = -1;
} |
8a70bab9-a238-48ae-b392-c39b5d9354b2 | public void lookAtSelection() {
if ( indexOfSelectedBox >= 0 ) {
Point3D p = scene.getBox( indexOfSelectedBox ).getCenter();
camera.lookAt(p);
}
} |
dfe6c8be-b9ff-46d6-b9dd-175d4e9ea1a0 | public void resetCamera() {
camera.setSceneRadius( (float)Math.max(
5 * ColoredBox.DEFAULT_SIZE,
scene.getBoundingBoxOfScene().getDiagonal().length() * 0.5f
) );
camera.reset();
} |
a7bb17ce-4875-4595-97ae-9fed8444f330 | public void saveCamera(){
CameraState cam = new CameraState(camera.position, camera.target, camera.up);
sm.getListCams().add(cam);
try{
//use buffering
OutputStream file = new FileOutputStream("cams.txt");
OutputStream buffer = new BufferedOutputStream(file);
ObjectOutput output = new ObjectOutputS... |
a26a2373-da6a-4c18-b8ff-aac0b22d9c89 | public void loadCamera(int index){
camera.position = ((CameraState)sm.getListCams().get(index)).getPosition();
camera.target = ((CameraState)sm.getListCams().get(index)).getTarget();
camera.up = ((CameraState)sm.getListCams().get(index)).getUp();
} |
796a3810-f539-48f6-b101-91c98e897309 | public void init( GLAutoDrawable drawable ) {
GL gl = drawable.getGL();
gl.glClearColor( 0, 0, 0, 0 );
glut = new GLUT();
} |
981511dd-de2b-4497-a15d-43c21519c966 | public void reshape(
GLAutoDrawable drawable,
int x, int y, int width, int height
) {
GL gl = drawable.getGL();
camera.setViewportDimensions(width, height);
// set viewport
gl.glViewport(0, 0, width, height);
} |
4916b709-fe37-4407-acac-7b532a7b221d | public void displayChanged(
GLAutoDrawable drawable,
boolean modeChanged,
boolean deviceChanged
) {
// leave this empty
} |
4d8ca760-255d-4820-bd64-02b09312ef95 | public void display( GLAutoDrawable drawable ) {
GL gl = drawable.getGL();
gl.glMatrixMode( GL.GL_PROJECTION );
gl.glLoadIdentity();
camera.transform( gl );
gl.glMatrixMode( GL.GL_MODELVIEW );
gl.glLoadIdentity();
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glDepthFunc( GL.GL_LEQUA... |
61ad9381-1441-4c6a-8236-2700e8676d2c | private void updateHiliting() {
Ray3D ray = camera.computeRay(mouse_x,mouse_y);
Point3D newIntersectionPoint = new Point3D();
Vector3D newNormalAtIntersection = new Vector3D();
int newIndexOfHilitedBox = scene.getIndexOfIntersectedBox(
ray, newIntersectionPoint, newNormalAtIntersection
);
hilitedPoint.co... |
a223a0e9-c1a1-4479-8d06-6e81f2ee51d0 | public void mouseClicked( MouseEvent e ) { } |
1c4999d0-4eac-4630-bb5b-59802a8ddab1 | public void mouseEntered( MouseEvent e ) { } |
be351d7d-277a-4324-b57f-521e236a7b34 | public void mouseExited( MouseEvent e ) { } |
6a126351-3a05-4783-aa54-6a643f8f1e6e | public void mousePressed( MouseEvent e ) {
old_mouse_x = mouse_x;
old_mouse_y = mouse_y;
mouse_x = e.getX();
mouse_y = e.getY();
if( SwingUtilities.isLeftMouseButton(e) && e.isShiftDown() && !e.isControlDown() && !e.isAltDown()){
if ( indexOfHilitedBox >= 0 && indexOfHilitedBox < scene.coloredBoxes.size(... |
e56a63ac-b527-4965-94a2-5fd71179ffe1 | public void mouseReleased( MouseEvent e ) {
old_mouse_x = mouse_x;
old_mouse_y = mouse_y;
mouse_x = e.getX();
mouse_y = e.getY();
if ( radialMenu.isVisible() ) {
int returnValue = radialMenu.releaseEvent( mouse_x, mouse_y );
int itemID = radialMenu.getItemID(radialMenu.getSelection());
switch ( ite... |
00ed55c5-996a-49fa-b5f7-aaf851bf36bd | public void mouseMoved( MouseEvent e ) {
old_mouse_x = mouse_x;
old_mouse_y = mouse_y;
mouse_x = e.getX();
mouse_y = e.getY();
if ( radialMenu.isVisible() ) {
int returnValue = radialMenu.moveEvent( mouse_x, mouse_y );
if ( returnValue == CustomWidget.S_REDRAW )
repaint();
if ( returnValue != C... |
cdb8c356-8811-48ca-bbcc-75011ada74de | public void mouseDragged( MouseEvent e ) {
old_mouse_x = mouse_x;
old_mouse_y = mouse_y;
mouse_x = e.getX();
mouse_y = e.getY();
int delta_x = mouse_x - old_mouse_x;
int delta_y = old_mouse_y - mouse_y;
if ( radialMenu.isVisible() ) {
int returnValue = radialMenu.dragEvent( mouse_x, mouse_y );
if (... |
442795dd-cee4-4d3b-9541-c3fc7cc10cec | public JPanel getColorPanel(){
return colorPanel;
} |
60b0efbc-e297-4aee-abd5-f37008a38b8c | public JTextField getRedText(){
return redText;
} |
113001be-4772-45c3-8587-4391f021d9c0 | public JTextField getGreenText(){
return greenText;
} |
5df6cc0f-cbe8-45f9-a799-ba5dfaa07159 | public JTextField getBlueText(){
return blueText;
} |
8eb54d2e-14e4-4cea-ad81-1a2a45a80618 | public JTextField getAlphaText(){
return alphaText;
} |
8f3e9630-8178-464b-a769-83ea2eaeaf42 | public void actionPerformed(ActionEvent e) {
Object source = e.getSource();
if ( source == deleteAllMenuItem ) {
int response = JOptionPane.showConfirmDialog(
frame,
"Really delete all?",
"Confirm Delete All",
JOptionPane.YES_NO_OPTION
);
if (response == JOptionPane.YES_OPTION) {
scene... |
69a98078-9d15-4c8e-935c-9ba7563924b4 | private void createUI() {
if ( ! SwingUtilities.isEventDispatchThread() ) {
System.out.println(
"Warning: UI is not being created in the Event Dispatch Thread!");
assert false;
}
frame = new JFrame( applicationName );
frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
generateMenu();
too... |
393e4def-514a-4861-b4e0-038e07d5e410 | public void generateMenu(){
menuBar = new JMenuBar();
JMenu menu = new JMenu("File");
deleteAllMenuItem = new JMenuItem("Delete All");
deleteAllMenuItem.addActionListener(this);
menu.add(deleteAllMenuItem);
menu.addSeparator();
quitMenuItem = new JMenuItem("Quit");
quitMenuItem.addActionListener... |
5a1e4278-761e-4a27-961a-7fc53db6b705 | public void getCamListMenuItems(){
try{
InputStream file = new FileInputStream("cams.txt");
InputStream buffer = new BufferedInputStream(file);
ObjectInput input = new ObjectInputStream (buffer);
try{
listCams = (ArrayList<CameraState>)input.readObject();
camMenuItems = new ArrayLis... |
26ff3f80-8b07-443e-8e43-0a5c7457bb37 | public ArrayList<CameraState> getListCams() {
return listCams;
} |
51cc449d-f356-44db-8062-1a4e1102c1f7 | public void setListCams(ArrayList<CameraState> listCams) {
this.listCams = listCams;
} |
94f7720f-8d99-4cbd-ac5e-7b492f2837da | public static void main( String[] args ) {
// Schedule the creation of the UI for the event-dispatching thread.
javax.swing.SwingUtilities.invokeLater(
new Runnable() {
public void run() {
SimpleModeller sp = new SimpleModeller();
sp.createUI();
}
}
);
} |
3e604f14-d676-47a9-99e9-dd07a1ced73f | public void run() {
SimpleModeller sp = new SimpleModeller();
sp.createUI();
} |
00a3da41-a4cd-4fad-aeb7-d573d189a519 | public Camera3D() {
reset();
} |
431e7570-5607-4b05-a797-d51f9daef646 | public void reset() {
float tangent = (float)Math.tan( fieldOfViewInDegrees/2 / 180 * (float)Math.PI );
float distanceFromTarget = sceneRadius / tangent;
position = new Point3D(0, 0, distanceFromTarget );
target = new Point3D(0, 0, 0);
up = ground;
} |
2aa43dde-c84d-4665-a093-8ea4c90d3bb4 | public void setViewportDimensions( int widthInPixels, int heightInPixels ) {
viewportWidthInPixels = widthInPixels;
viewportHeightInPixels = heightInPixels;
viewportRadiusInPixels = widthInPixels < heightInPixels
? 0.5f*widthInPixels : 0.5f*heightInPixels;
} |
cce1ca71-ab85-40f6-8055-9383a7ada6c0 | public int getViewportWidth() { return viewportWidthInPixels; } |
253b9d98-0cf6-44df-9377-e9b13da5afc5 | public int getViewportHeight() { return viewportHeightInPixels; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.