com.quinncurtis.chart3djava
Class ScrollBarRotate3DControl

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Dialog
                  extended by javax.swing.JDialog
                      extended by com.quinncurtis.chart3djava.ScrollBarRotate3DControl
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class ScrollBarRotate3DControl
extends javax.swing.JDialog
implements java.awt.event.AdjustmentListener, java.awt.event.ActionListener, java.awt.event.WindowListener

A dialog box that uses scroll bars to contol the rotation of one or more transforms.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ScrollBarRotate3DControl()
          Default constructor
ScrollBarRotate3DControl(javax.swing.JFrame frame, ChartView chartvu, PhysicalCoordinates[] transforms, ChartPoint3D initialvalues, int lightlevel)
          Constructor for create a dialog box to rotate multiple coordinate systems.
ScrollBarRotate3DControl(javax.swing.JFrame frame, ChartView chartvu, PhysicalCoordinates transform, ChartPoint3D initialvalues, int lightlevel)
          Constructor for create a dialog box to rotate a single coordinate system.
ScrollBarRotate3DControl(javax.swing.JFrame frame, ChartView chartvu, java.util.Vector transforms, ChartPoint3D initialvalues, int lightlevel)
          Constructor for create a dialog box to rotate multiple coordinate systems.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          The actionPerformed event method for this object.
 boolean addTransform(PhysicalCoordinates transform)
          Add an additional coordinate system to the list of coordinate systems under control.
 void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
          The mouseReleased event method for this object.
 int getDialogResult()
          Returns the value of the dialog result.
 int getLargeChange()
          Get the large change value for the scroll bars.
 int getMaximumRotate()
          Get the maximum allowable rotate value for the scroll bars.
 int getMinimumRotate()
          Get the minimum allowable rotate value for the scroll bars.
 ChartPoint3D getScrollBarValues()
          Get the current rotation parameters for the scroll bars.
 int getSmallChange()
          Get the small change value for the scroll bars.
 javax.swing.JScrollBar getXScrollBar()
          Get a reference to the x-rotation scroll bar.
 javax.swing.JScrollBar getYScrollBar()
          Get a reference to the y-rotation scroll bar.
 javax.swing.JScrollBar getZScrollBar()
          Get a reference to the z-rotation scroll bar.
 void initScrollBarRotate3DControl(javax.swing.JFrame frame, ChartView chartvu, PhysicalCoordinates[] transforms, ChartPoint3D initialvalues, int lightlevel)
          Initialize a dialog box to rotate multiple coordinate systems.
 void initScrollBarRotate3DControl(javax.swing.JFrame frame, ChartView chartvu, PhysicalCoordinates transform, ChartPoint3D initialvalues, int lightlevel)
          Initialize a dialog box to rotate a coordinate system.
 void initScrollBarRotate3DControl(javax.swing.JFrame frame, ChartView chartvu, java.util.Vector transforms, ChartPoint3D initialvalues, int lightlevel)
          Initialize a dialog box to rotate multiple coordinate systems.
 void resetTransform3D(boolean wireframe)
          Reset the transforms back to a (0,0,0) rotation state, with a 100% lighting, and redraw.
 void rotateTransform3D(boolean wireframe)
          Update the 3D transforms of the coordinate system using the current scroll bar values and redraw the ChartView.
 void scrollBarEnable(boolean enable)
          Enable the scroll bars.
 void setLargeChange(int value)
          Set the large change value for the scroll bars.
 void setMaximumRotate(int value)
          Set the maximum allowable rotate value for the scroll bars.
 void setMinimumRotate(int value)
          Set the minimum allowable rotate value for the scroll bars.
 void setScrollBarValues(ChartPoint3D value)
          Sets the current values of the rotation scroll bars.
 void setSmallChange(int value)
          Set the small change value for the scroll bars.
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class javax.swing.JDialog
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, update
 
Methods inherited from class java.awt.Dialog
addNotify, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScrollBarRotate3DControl

public ScrollBarRotate3DControl()
Default constructor


ScrollBarRotate3DControl

public ScrollBarRotate3DControl(javax.swing.JFrame frame,
                                ChartView chartvu,
                                PhysicalCoordinates transform,
                                ChartPoint3D initialvalues,
                                int lightlevel)
Constructor for create a dialog box to rotate a single coordinate system.

Parameters:
frame - Dialog JFrame.
chartvu - Associated ChartView component.
transform - Transform that you want to control.
initialvalues - Initial rotation values for coordinate system.
lightlevel - Initial light level for coordinate system.

ScrollBarRotate3DControl

public ScrollBarRotate3DControl(javax.swing.JFrame frame,
                                ChartView chartvu,
                                PhysicalCoordinates[] transforms,
                                ChartPoint3D initialvalues,
                                int lightlevel)
Constructor for create a dialog box to rotate multiple coordinate systems.

Parameters:
frame - Dialog JFrame.
chartvu - Associated ChartView component.
transforms - An array of transform that you want to control.
initialvalues - Initial rotation values for coordinate systems.
lightlevel - Initial light level for coordinate systems.

ScrollBarRotate3DControl

public ScrollBarRotate3DControl(javax.swing.JFrame frame,
                                ChartView chartvu,
                                java.util.Vector transforms,
                                ChartPoint3D initialvalues,
                                int lightlevel)
Constructor for create a dialog box to rotate multiple coordinate systems.

Parameters:
frame - Dialog JFrame.
chartvu - Associated ChartView component.
transforms - A vector of transform that you want to control.
initialvalues - Initial rotation values for coordinate systems.
lightlevel - Initial light level for coordinate systems.
Method Detail

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Specified by:
windowClosing in interface java.awt.event.WindowListener

adjustmentValueChanged

public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
The mouseReleased event method for this object.

Specified by:
adjustmentValueChanged in interface java.awt.event.AdjustmentListener
Parameters:
e - The mouse event contains status information about the mouse.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
The actionPerformed event method for this object.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
event - The mouse event contains status information about the mouse.

initScrollBarRotate3DControl

public void initScrollBarRotate3DControl(javax.swing.JFrame frame,
                                         ChartView chartvu,
                                         java.util.Vector transforms,
                                         ChartPoint3D initialvalues,
                                         int lightlevel)
Initialize a dialog box to rotate multiple coordinate systems.

Parameters:
frame - Dialog JFrame.
chartvu - Associated ChartView component.
transforms - A vector of transform that you want to control.
initialvalues - Initial rotation values for coordinate systems.
lightlevel - Initial light level for coordinate systems.

initScrollBarRotate3DControl

public void initScrollBarRotate3DControl(javax.swing.JFrame frame,
                                         ChartView chartvu,
                                         PhysicalCoordinates[] transforms,
                                         ChartPoint3D initialvalues,
                                         int lightlevel)
Initialize a dialog box to rotate multiple coordinate systems.

Parameters:
frame - Dialog JFrame.
chartvu - Associated ChartView component.
transforms - An array of transform that you want to control.
initialvalues - Initial rotation values for coordinate systems.
lightlevel - Initial light level for coordinate systems.

initScrollBarRotate3DControl

public void initScrollBarRotate3DControl(javax.swing.JFrame frame,
                                         ChartView chartvu,
                                         PhysicalCoordinates transform,
                                         ChartPoint3D initialvalues,
                                         int lightlevel)
Initialize a dialog box to rotate a coordinate system.

Parameters:
frame - Dialog JFrame.
chartvu - Associated ChartView component.
transform - Transform that you want to control.
initialvalues - Initial rotation values for coordinate systems.
lightlevel - Initial light level for coordinate systems.

addTransform

public boolean addTransform(PhysicalCoordinates transform)
Add an additional coordinate system to the list of coordinate systems under control.

Parameters:
transform - The additional coordinate system to add.
Returns:
Returns the current number of control systems under control.

rotateTransform3D

public void rotateTransform3D(boolean wireframe)
Update the 3D transforms of the coordinate system using the current scroll bar values and redraw the ChartView.

Parameters:
wireframe - Set to true to draw in wire frame mode.

scrollBarEnable

public void scrollBarEnable(boolean enable)
Enable the scroll bars.

Parameters:
enable - Set to true to enable.

resetTransform3D

public void resetTransform3D(boolean wireframe)
Reset the transforms back to a (0,0,0) rotation state, with a 100% lighting, and redraw.

Parameters:
wireframe - Set to true to enable wire frame drawing mode.

getScrollBarValues

public ChartPoint3D getScrollBarValues()
Get the current rotation parameters for the scroll bars.

Returns:
Returns a 3D point containing the rotation values of the scroll bars.

setScrollBarValues

public void setScrollBarValues(ChartPoint3D value)
Sets the current values of the rotation scroll bars.

Parameters:
value - The 3D point used to set the rotation values of the scroll bars.

getMinimumRotate

public int getMinimumRotate()
Get the minimum allowable rotate value for the scroll bars.

Returns:
Returns the minimum allowable rotate value for the scroll bars.

setMinimumRotate

public void setMinimumRotate(int value)
Set the minimum allowable rotate value for the scroll bars.

Parameters:
value - The minimum allowable rotate value for the scroll bars.

getMaximumRotate

public int getMaximumRotate()
Get the maximum allowable rotate value for the scroll bars.

Returns:
Returns the maximum allowable rotate value for the scroll bars.

setMaximumRotate

public void setMaximumRotate(int value)
Set the maximum allowable rotate value for the scroll bars.

Parameters:
value - The maximum allowable rotate value for the scroll bars.

getSmallChange

public int getSmallChange()
Get the small change value for the scroll bars.

Returns:
Returns the small change value for the scroll bars.

setSmallChange

public void setSmallChange(int value)
Set the small change value for the scroll bars.

Parameters:
value - Set the small change value for the scroll bars.

getLargeChange

public int getLargeChange()
Get the large change value for the scroll bars.

Returns:
Returns the large change value for the scroll bars.

setLargeChange

public void setLargeChange(int value)
Set the large change value for the scroll bars.

Parameters:
value - Sets the large change value for the scroll bars.

getXScrollBar

public javax.swing.JScrollBar getXScrollBar()
Get a reference to the x-rotation scroll bar.

Returns:
Returns a reference to the x-rotation scroll bar.

getYScrollBar

public javax.swing.JScrollBar getYScrollBar()
Get a reference to the y-rotation scroll bar.

Returns:
Returns a reference to the y-rotation scroll bar.

getZScrollBar

public javax.swing.JScrollBar getZScrollBar()
Get a reference to the z-rotation scroll bar.

Returns:
Returns a reference to the z-rotation scroll bar.

getDialogResult

public int getDialogResult()
Returns the value of the dialog result.

Returns:
Returns the value of the dialog result.