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.AccessibleAWTPanel

    Nested classes/interfaces inherited from class java.awt.Container

    java.awt.Container.AccessibleAWTContainer

    Nested 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 int lastsect  
    protected int lastsecx  
    protected int lastsecy  
    protected long lastt  
    protected int lastx  
    protected int lasty  
    protected Applet3d parent  
    protected static int SENSITIVITY  
    protected static int THRESHOLD  
    protected static int TIMESLICE  

    Fields inherited from class java.awt.Component

    accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT

    Fields inherited from interface java.awt.image.ImageObserver

    ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
  • Constructor Summary

    Constructors
    Constructor Description
    Viewer​(Applet3d parent)  
  • Method Summary

    Modifier and Type Method Description
    boolean action​(java.awt.Event e, java.lang.Object arg)  
    int addColor​(java.awt.Color c)
    Add a color that the user cannot make invisible
    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
    protected void calcLastSec​(int x, int y, long t)
    Estimate mouse movement in last second
    void extraColors​(int[] extras)
    Remove any existing extra colors and replace with a new set
    View3d get()  
    View3d getView()  
    java.lang.String idVRML​(int col)  
    void lessControls()
    remove controls for colour, animation, etc
    void moreControls​(java.awt.Button moreButton)
    show controls for colour, animation, etc
    boolean mouseDown​(java.awt.Event e, int x, int y)  
    boolean mouseDrag​(java.awt.Event e, int x, int y)  
    boolean mouseUp​(java.awt.Event e, int x, int y)  
    void paint​(java.awt.Graphics g)  
    void put()  
    void put​(int deltax, int deltay, int modifiers)  
    void put​(int i, java.awt.Color c)  
    void putFrameNo​(int frameNo)
    this sets the frame no in the View
    void setColorVisibility​(int col, boolean visibility)
    Set the visibility of a colour
    void setFrameNo​(int frameNo)
    this sets the frame no in the AnimationWidget
    void setGraphics​(java.awt.Graphics g, int width, int height)  
    void setHome​(View3dInfo view)  
    void setModel​(Object3d model)  
    boolean setView​(View3dInfo view)  
    boolean setView​(java.lang.String viewname)
    set the view direction.
    void setViewLock​(boolean locked)  
    void setWindow​(double wx, double wy, double wwidth, double wheight)  
    void spinOff()  
    void spinOn​(double spinx, double spiny)  
    void start()  
    void stop()  
    void toVRML​(VRMLState v)  
    void transform​(au.edu.unsw.cse.Matrix3D T)  
    java.lang.String vrmlPROTO()  

    Methods inherited from class java.awt.Panel

    addNotify, getAccessibleContext

    Methods 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, validateTree

    Methods 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, transferFocusUpCycle

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • parent

      protected Applet3d 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

      public Viewer​(Applet3d parent)
  • 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

      public void setModel​(Object3d model)
    • 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:
      paint in class java.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

      public boolean setView​(View3dInfo view)
    • setHome

      public void setHome​(View3dInfo view)
    • setViewLock

      public void setViewLock​(boolean locked)
    • action

      public boolean action​(java.awt.Event e, java.lang.Object arg)
      Overrides:
      action in class java.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:
      mouseDown in class java.awt.Component
    • mouseUp

      public boolean mouseUp​(java.awt.Event e, int x, int y)
      Overrides:
      mouseUp in class java.awt.Component
    • mouseDrag

      public boolean mouseDrag​(java.awt.Event e, int x, int y)
      Overrides:
      mouseDrag in class java.awt.Component
    • calcLastSec

      protected void calcLastSec​(int x, int y, long t)
      Estimate mouse movement in last second
    • get

      public View3d get()
    • getView

      public View3d getView()
    • vrmlPROTO

      public java.lang.String vrmlPROTO()
    • toVRML

      public void toVRML​(VRMLState v)
    • idVRML

      public java.lang.String idVRML​(int col)