org.vizzini.ui.graphics
Class ObjectViewerAWT

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by org.vizzini.ui.graphics.ObjectViewerAWT
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, IViewer

 class ObjectViewerAWT
extends Panel
implements IViewer

Provides an AWT 3D object viewer.

Since:
v0.2
Version:
v0.3
Author:
Jeffrey M. Thompson

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Panel
Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  int _xRotation
          The X rotation angle in degrees.
protected  int _yRotation
          The Y rotation angle in degrees.
protected  int _zRotation
          The Z rotation angle in degrees.
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface org.vizzini.ui.graphics.IViewer
MAGNIFICATION_FACTOR
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ObjectViewerAWT()
          Construct this object.
 
Method Summary
 void add(IShape shape)
          Add the given shape.
protected  Panel createMagnifyPanel()
          Create a panel containing the magnification controls.
 double getMagnify()
          Return the magnification.
 double getPerspectiveConstant()
          Return the perspective constant.
 boolean isViewPointLightUsed()
           
 void remove(IShape shape)
          Remove the given shape.
 void setCanvasBackground(Color color)
          Set the canvas background color.
 void setMagnify(double magnify)
          Set the magnification.
 void setMagnifyPanelVisible(boolean isVisible)
          Set the visibility of the magnification panel.
 void setPerspectiveConstant(double d)
          Set the perspective constant.
 void setViewPointLightUsed(boolean isViewPointLightUsed)
           
 void setXScrollBarBlockIncrement(int increment)
          Set the block increment on the X scroll bar.
 void setXScrollBarUnitIncrement(int increment)
          Set the unit increment on the X scroll bar.
 void setXScrollBarValues(int value, int visible, int minimum, int maximum)
          Set the values on the X scroll bar.
 void setXScrollBarVisible(boolean isVisible)
          Set the visibility of the X scroll bar.
 void setYScrollBarBlockIncrement(int increment)
          Set the block increment on the Y scroll bar.
 void setYScrollBarUnitIncrement(int increment)
          Set the unit increment on the Y scroll bar.
 void setYScrollBarValues(int value, int visible, int minimum, int maximum)
          Set the values on the Y scroll bar.
 void setYScrollBarVisible(boolean isVisible)
          Set the visibility of the Y scroll bar.
 void setZScrollBarBlockIncrement(int increment)
          Set the block increment on the Z scroll bar.
 void setZScrollBarUnitIncrement(int increment)
          Set the unit increment on the Z scroll bar.
 void setZScrollBarValues(int value, int visible, int minimum, int maximum)
          Set the values on the Z scroll bar.
 void setZScrollBarVisible(boolean isVisible)
          Set the visibility of the Z scroll bar.
 void update()
          Update the shapes in this viewer.
 
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, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, 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, 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, getPeer, 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, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, 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, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_xRotation

protected int _xRotation
The X rotation angle in degrees.


_yRotation

protected int _yRotation
The Y rotation angle in degrees.


_zRotation

protected int _zRotation
The Z rotation angle in degrees.

Constructor Detail

ObjectViewerAWT

public ObjectViewerAWT()
Construct this object.

Since:
v0.2
Method Detail

add

public void add(IShape shape)
Add the given shape.

Specified by:
add in interface IViewer
Since:
v0.2

getMagnify

public double getMagnify()
Return the magnification.

Specified by:
getMagnify in interface IViewer
Since:
v0.2

getPerspectiveConstant

public double getPerspectiveConstant()
Return the perspective constant.

Specified by:
getPerspectiveConstant in interface IViewer
Since:
v0.2

isViewPointLightUsed

public boolean isViewPointLightUsed()
Specified by:
isViewPointLightUsed in interface IViewer
Returns:
Return isViewPointLightUsed.
Since:
v0.3

remove

public void remove(IShape shape)
Remove the given shape.

Specified by:
remove in interface IViewer
Since:
v0.2

setCanvasBackground

public void setCanvasBackground(Color color)
Set the canvas background color.

Specified by:
setCanvasBackground in interface IViewer
Since:
v0.2

setMagnify

public void setMagnify(double magnify)
Set the magnification.

Specified by:
setMagnify in interface IViewer
Since:
v0.2

setMagnifyPanelVisible

public void setMagnifyPanelVisible(boolean isVisible)
Set the visibility of the magnification panel.

Specified by:
setMagnifyPanelVisible in interface IViewer
Since:
v0.2

setPerspectiveConstant

public void setPerspectiveConstant(double d)
Set the perspective constant.

Specified by:
setPerspectiveConstant in interface IViewer
Since:
v0.2

setViewPointLightUsed

public void setViewPointLightUsed(boolean isViewPointLightUsed)
Specified by:
setViewPointLightUsed in interface IViewer
Parameters:
isViewPointLightUsed - the isViewPointLightUsed to set
Since:
v0.3

setXScrollBarBlockIncrement

public void setXScrollBarBlockIncrement(int increment)
Set the block increment on the X scroll bar.

Specified by:
setXScrollBarBlockIncrement in interface IViewer
Parameters:
increment - The amount by which to increment or decrement the scroll bar's value.
Since:
v0.2

setXScrollBarUnitIncrement

public void setXScrollBarUnitIncrement(int increment)
Set the unit increment on the X scroll bar.

Specified by:
setXScrollBarUnitIncrement in interface IViewer
Parameters:
increment - The amount by which to increment or decrement the scroll bar's value.
Since:
v0.2

setXScrollBarValues

public void setXScrollBarValues(int value,
                                int visible,
                                int minimum,
                                int maximum)
Set the values on the X scroll bar.

Specified by:
setXScrollBarValues in interface IViewer
Parameters:
value - The position in the current window.
visible - The amount visible per page.
minimum - The minimum value of the scroll bar.
maximum - The maximum value of the scroll bar.
Since:
v0.2

setXScrollBarVisible

public void setXScrollBarVisible(boolean isVisible)
Set the visibility of the X scroll bar.

Specified by:
setXScrollBarVisible in interface IViewer
Parameters:
isVisible - Flag indicating if the scroll bar is visible.
Since:
v0.2

setYScrollBarBlockIncrement

public void setYScrollBarBlockIncrement(int increment)
Set the block increment on the Y scroll bar.

Specified by:
setYScrollBarBlockIncrement in interface IViewer
Parameters:
increment - The amount by which to increment or decrement the scroll bar's value.
Since:
v0.2

setYScrollBarUnitIncrement

public void setYScrollBarUnitIncrement(int increment)
Set the unit increment on the Y scroll bar.

Specified by:
setYScrollBarUnitIncrement in interface IViewer
Parameters:
increment - The amount by which to increment or decrement the scroll bar's value.
Since:
v0.2

setYScrollBarValues

public void setYScrollBarValues(int value,
                                int visible,
                                int minimum,
                                int maximum)
Set the values on the Y scroll bar.

Specified by:
setYScrollBarValues in interface IViewer
Parameters:
value - The position in the current window.
visible - The amount visible per page.
minimum - The minimum value of the scroll bar.
maximum - The maximum value of the scroll bar.
Since:
v0.2

setYScrollBarVisible

public void setYScrollBarVisible(boolean isVisible)
Set the visibility of the Y scroll bar.

Specified by:
setYScrollBarVisible in interface IViewer
Parameters:
isVisible - Flag indicating if the scroll bar is visible.
Since:
v0.2

setZScrollBarBlockIncrement

public void setZScrollBarBlockIncrement(int increment)
Set the block increment on the Z scroll bar.

Specified by:
setZScrollBarBlockIncrement in interface IViewer
Parameters:
increment - The amount by which to increment or decrement the scroll bar's value.
Since:
v0.2

setZScrollBarUnitIncrement

public void setZScrollBarUnitIncrement(int increment)
Set the unit increment on the Z scroll bar.

Specified by:
setZScrollBarUnitIncrement in interface IViewer
Parameters:
increment - The amount by which to increment or decrement the scroll bar's value.
Since:
v0.2

setZScrollBarValues

public void setZScrollBarValues(int value,
                                int visible,
                                int minimum,
                                int maximum)
Set the values on the Z scroll bar.

Specified by:
setZScrollBarValues in interface IViewer
Parameters:
value - The position in the current window.
visible - The amount visible per page.
minimum - The minimum value of the scroll bar.
maximum - The maximum value of the scroll bar.
Since:
v0.2

setZScrollBarVisible

public void setZScrollBarVisible(boolean isVisible)
Set the visibility of the Z scroll bar.

Specified by:
setZScrollBarVisible in interface IViewer
Parameters:
isVisible - Flag indicating if the scroll bar is visible.
Since:
v0.2

update

public void update()
Update the shapes in this viewer.

Specified by:
update in interface IViewer
Since:
v0.3

createMagnifyPanel

protected Panel createMagnifyPanel()
Create a panel containing the magnification controls.

Since:
v0.2


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02