Package au.edu.unsw.cse
Class Viewer
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Panel
au.edu.unsw.cse.Viewer
- All Implemented Interfaces:
java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,javax.accessibility.Accessible
public class Viewer
extends java.awt.Panel
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanelNested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy -
Field Summary
Fields Modifier and Type Field Description protected intlastsectprotected intlastsecxprotected intlastsecyprotected longlasttprotected intlastxprotected intlastyprotected Applet3dparentprotected static intSENSITIVITYprotected static intTHRESHOLDprotected static intTIMESLICEFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
-
Method Summary
Modifier and Type Method Description booleanaction(java.awt.Event e, java.lang.Object arg)intaddColor(java.awt.Color c)Add a color that the user cannot make invisibleintaddColor(java.lang.String label, java.lang.String tip, boolean state, java.awt.Color c, boolean shouldAdd)Add a checkbox allowing user to set objects of this colour to be invisibleprotected voidcalcLastSec(int x, int y, long t)Estimate mouse movement in last secondvoidextraColors(int[] extras)Remove any existing extra colors and replace with a new setView3dget()View3dgetView()java.lang.StringidVRML(int col)voidlessControls()remove controls for colour, animation, etcvoidmoreControls(java.awt.Button moreButton)show controls for colour, animation, etcbooleanmouseDown(java.awt.Event e, int x, int y)booleanmouseDrag(java.awt.Event e, int x, int y)booleanmouseUp(java.awt.Event e, int x, int y)voidpaint(java.awt.Graphics g)voidput()voidput(int deltax, int deltay, int modifiers)voidput(int i, java.awt.Color c)voidputFrameNo(int frameNo)this sets the frame no in the ViewvoidsetColorVisibility(int col, boolean visibility)Set the visibility of a colourvoidsetFrameNo(int frameNo)this sets the frame no in the AnimationWidgetvoidsetGraphics(java.awt.Graphics g, int width, int height)voidsetHome(View3dInfo view)voidsetModel(Object3d model)booleansetView(View3dInfo view)booleansetView(java.lang.String viewname)set the view direction.voidsetViewLock(boolean locked)voidsetWindow(double wx, double wy, double wwidth, double wheight)voidspinOff()voidspinOn(double spinx, double spiny)voidstart()voidstop()voidtoVRML(VRMLState v)voidtransform(au.edu.unsw.cse.Matrix3D T)java.lang.StringvrmlPROTO()Methods inherited from class java.awt.Panel
addNotify, getAccessibleContextMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, isValidateRoot, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate, validateTreeMethods inherited from class java.awt.Component
add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseEnter, mouseExit, mouseMove, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
parent
-
SENSITIVITY
protected static final int SENSITIVITY- See Also:
- Constant Field Values
-
lastx
protected int lastx -
lasty
protected int lasty -
lastt
protected long lastt -
THRESHOLD
protected static final int THRESHOLD- See Also:
- Constant Field Values
-
lastsecx
protected int lastsecx -
lastsecy
protected int lastsecy -
lastsect
protected int lastsect -
TIMESLICE
protected static final int TIMESLICE- See Also:
- Constant Field Values
-
-
Constructor Details
-
Viewer
-
-
Method Details
-
moreControls
public void moreControls(java.awt.Button moreButton)show controls for colour, animation, etc -
lessControls
public void lessControls()remove controls for colour, animation, etc -
addColor
public int addColor(java.lang.String label, java.lang.String tip, boolean state, java.awt.Color c, boolean shouldAdd)Add a checkbox allowing user to set objects of this colour to be invisible -
addColor
public int addColor(java.awt.Color c)Add a color that the user cannot make invisible -
extraColors
public void extraColors(int[] extras)Remove any existing extra colors and replace with a new set -
setColorVisibility
public void setColorVisibility(int col, boolean visibility)Set the visibility of a colour -
setModel
-
transform
public void transform(au.edu.unsw.cse.Matrix3D T) -
start
public void start() -
stop
public void stop() -
paint
public void paint(java.awt.Graphics g)- Overrides:
paintin classjava.awt.Container
-
setView
public boolean setView(java.lang.String viewname)set the view direction. We pass the name on the button. return true if we are succesful. -
setView
-
setHome
-
setViewLock
public void setViewLock(boolean locked) -
action
public boolean action(java.awt.Event e, java.lang.Object arg)- Overrides:
actionin classjava.awt.Component
-
put
public void put(int deltax, int deltay, int modifiers) -
put
public void put() -
put
public void put(int i, java.awt.Color c) -
setGraphics
public void setGraphics(java.awt.Graphics g, int width, int height) -
setWindow
public void setWindow(double wx, double wy, double wwidth, double wheight) -
putFrameNo
public void putFrameNo(int frameNo)this sets the frame no in the View -
setFrameNo
public void setFrameNo(int frameNo)this sets the frame no in the AnimationWidget -
spinOn
public void spinOn(double spinx, double spiny) -
spinOff
public void spinOff() -
mouseDown
public boolean mouseDown(java.awt.Event e, int x, int y)- Overrides:
mouseDownin classjava.awt.Component
-
mouseUp
public boolean mouseUp(java.awt.Event e, int x, int y)- Overrides:
mouseUpin classjava.awt.Component
-
mouseDrag
public boolean mouseDrag(java.awt.Event e, int x, int y)- Overrides:
mouseDragin classjava.awt.Component
-
calcLastSec
protected void calcLastSec(int x, int y, long t)Estimate mouse movement in last second -
get
-
getView
-
vrmlPROTO
public java.lang.String vrmlPROTO() -
toVRML
-
idVRML
public java.lang.String idVRML(int col)
-