Package gov.nih.mipav.view.renderer.J3D
Class JPanelLights
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- gov.nih.mipav.view.renderer.JPanelRendererBase
-
- gov.nih.mipav.view.renderer.J3D.JPanelRendererJ3D
-
- gov.nih.mipav.view.renderer.J3D.JPanelLights
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.awt.event.FocusListener,java.awt.event.ItemListener,java.awt.event.KeyListener,java.awt.event.MouseListener,java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,java.util.EventListener,javax.accessibility.Accessible,javax.swing.event.ChangeListener,javax.swing.event.ListSelectionListener
public class JPanelLights extends JPanelRendererJ3D implements javax.swing.event.ChangeListener, java.awt.event.MouseListener, javax.swing.event.ListSelectionListener
Dialog to turn slices bounding box of surface renderer on and off, and to change the color of the frame. This dialog also control the X, Y, Z slices movements.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classJPanelLights.CancelListenerCancel the color dialog, change nothing.(package private) classJPanelLights.OkColorListenerPick up the selected color and call method to change the surface color.-
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JRadioButtonambientRadioRadio button for different light type.private booleanbNeedsRedrawFlag is set if one of the controls changed a value and the renderering needs to be redrawn when the mouse is released.private javax.swing.JCheckBoxcheckBoxShowLightCheck box to show the light bulb or not.private javax.swing.JButtoncolorButtonColor button, checkBox On/Off.private ViewJColorChoosercolorChooserColor choose dialog reference.private javax.swing.JLabelcolorLabelColor label.private javax.swing.JPanelcontrolPanelControl panel.private javax.swing.BoxcontrolPanelBoxControl panel box that hold the control panel.private javax.swing.JRadioButtondirectionalRadioDirectional light radio botton.private javax.swing.JPaneldrawPanelScroll panel reference.private javax.swing.JSliderintensitySliderIntensity slider.private intiSelectindex of currently selected one.private javax.swing.JLabellabelIntensityLight intensity label.private javax.swing.JLabellabelIntensityBeginLight intensity label begin.private javax.swing.JLabellabelIntensityEndLight intensity label end.private javax.swing.JLabellabelIntensityMidLight intensity label middle.private javax.swing.JLabellabelShininessLight shinness label.private javax.swing.JLabellabelShininessBeginShinness label begin.private javax.swing.JLabellabelShininessEndShinness label end.private javax.swing.JLabellabelShininessMidShinness lable middle.static intLIGHT_INDEX_AMBIENTAmbient light index.static intLIGHT_INDEX_MAXMax number of light.static intLIGHT_INDEX_MODEL_X0Y0Z0light for corner X0Y0Z0.static intLIGHT_INDEX_MODEL_X0Y0Z1light for corner X0Y0Z1.static intLIGHT_INDEX_MODEL_X0Y1Z0light for corner X0Y1Z0.static intLIGHT_INDEX_MODEL_X0Y1Z1light for corner X0Y1Z1.static intLIGHT_INDEX_MODEL_X1Y0Z0light for corner X1Y0Z0.static intLIGHT_INDEX_MODEL_X1Y0Z1light for corner X1Y0Z1.static intLIGHT_INDEX_MODEL_X1Y1Z0light for corner X1Y1Z0.static intLIGHT_INDEX_MODEL_X1Y1Z1light for corner X1Y1Z1.static intLIGHT_INDEX_STATICStatic light index.private javax.swing.JListlistList of lights.private int[]m_aiLightScaleLight scale factor array.private GeneralLight[]m_akLightsThe structure for the light bulbs.private GeneralLight[]m_akModelLightsGeneral light array.private SoftwareLight[]m_akSoftwareLightsModelSoft light array.private SoftwareLight[]m_akSoftwareLightsWorldLighting objects needed for software rendering.private GeneralLight[]m_akWorldLightsWorld general light array.private VolumeTriPlanarRenderm_kGPUVolumeRenderprivate javax.swing.JLabelm_kLabelPosXLabel for slider X position.private javax.swing.JLabelm_kLabelPosYLabel for slider Y position.private javax.swing.JLabelm_kLabelPosZLabel for slider Z position.private javax.swing.JLabelm_kLabelTrgXLabel for X light target position.private javax.swing.JLabelm_kLabelTrgYLabel for Y light target position.private javax.swing.JLabelm_kLabelTrgZLabel for Z light target position.private JPanelSurfacem_kPanelSurfacesurface panel reference.private SurfaceRenderm_kRenderSurfaceParent render frame reference.private javax.swing.JSliderm_kSliderPosXLight x position slider.private javax.swing.JSliderm_kSliderPosYLight y position slider.private javax.swing.JSliderm_kSliderPosZLight z position slider.private javax.swing.JSliderm_kSliderTrgXLight x target position slider.private javax.swing.JSliderm_kSliderTrgYLight y target position slider.private javax.swing.JSliderm_kSliderTrgZLight z target position slider.private javax.swing.JTextFieldm_kTextPosXX position text field.private javax.swing.JTextFieldm_kTextPosYY position text field.private javax.swing.JTextFieldm_kTextPosZZ position text field.private javax.swing.JTextFieldm_kTextTrgXX target position text field.private javax.swing.JTextFieldm_kTextTrgYY target position text field.private javax.swing.JTextFieldm_kTextTrgZZ target position text field.private floatmaxBoxx, y, z box size.private javax.swing.JCheckBoxonOffCheckBoxLight turn on/off check box.private javax.swing.JLabelonOffLabelLight turn on/off label.private javax.swing.JRadioButtonpointRadioPoint light radio button.private javax.swing.JScrollPanescrollerScroll pane.private javax.swing.JPanelscrollPanelScroll the control panel when the frame changes size.private static longserialVersionUIDUse serialVersionUID for interoperability.private javax.swing.JPanelshininessPanelShininess panel.private javax.swing.JSlidershininessSliderShininess slider.private javax.swing.JRadioButtonspotRadioSpot light radio button.private javax.swing.JTextFieldtextIntensityLight intensity textfield.private javax.swing.JTextFieldtextShininessLight shinness textfield.private floatxBoxx, y, z box size.private floatyBoxx, y, z box size.private floatzBoxx, y, z box size.-
Fields inherited from class gov.nih.mipav.view.renderer.J3D.JPanelRendererJ3D
rayBasedRender, renderBase
-
Fields inherited from class gov.nih.mipav.view.renderer.JPanelRendererBase
applyButton, cancelButton, cancelFlag, closeButton, helpButton, isActiveImage, mainPanel, NEW, OKButton, REPLACE, runInSeparateThread, serif12, serif12B
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description JPanelLights(JPanelSurface kPanelSurface, SurfaceRender kRenderSurface)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent event)Changes color of slices box frame and button if color button was pressed; turns bounding box on and off if checkbox was pressed; and closes dialog if "Close" button was pressed.private voidaddControlPanel(javax.swing.JPanel panelControl, java.awt.Component c, java.awt.GridBagConstraints gbc, int x, int y, int w, int h)Helper method that adds components to the control panel for the grid bag layout.private voidbuildControlPanel()Build the light control panel.private voidbuildListPanel()Build the light list panel.private voidbuildShininessPanel()Build the shinness control panel.private javax.swing.JLabelcreateLabel(java.lang.String title, boolean bEnable)Creates a label in the proper font and color.voiddisposeLocal(boolean flag)Clear memory and garbage collection.voidenableLight(int iSelect, boolean bOn)protected voidfinalize()Calls dispose.GeneralLightgetGeneralLight(int iIndex)The the general light with the given index.GeneralLight[]getGeneralLights()Returns all general lights.javax.swing.JPanelgetMainPanel()Get the main control Panel.intgetNumLights()Get the number of lights.SoftwareLight[]getSoftwareLightsModel()Get the software light model.SoftwareLight[]getSoftwareLightsWorld()Get the software light world.voidmouseClicked(java.awt.event.MouseEvent event)Unchanged.voidmouseEntered(java.awt.event.MouseEvent event)Unchanged.voidmouseExited(java.awt.event.MouseEvent event)Unchanged.voidmousePressed(java.awt.event.MouseEvent event)Unchanged.voidmouseReleased(java.awt.event.MouseEvent event)Used in MouseRecorder to stop one series of slide moves.voidrefreshControlPanel()Refresh the light control panel.voidrefreshLighting()Repaints the parent frame with the correct lighting.voidresizePanel(int panelWidth, int frameHeight)Resizig the control panel with ViewJFrameVolumeView's frame width and height.voidsetSelectedIndex(int index)Sets the light to selected.voidstateChanged(javax.swing.event.ChangeEvent e)Slider move event handler.voidupdateSoftwareLights()Get the current SoftwareLight instances from each of the GeneralLight instances -- for the world- and model-based lights.voidvalueChanged(javax.swing.event.ListSelectionEvent kEvent)Sets values of sliders and intensities appropriately based on which light was chosen in the list.-
Methods inherited from class gov.nih.mipav.view.renderer.J3D.JPanelRendererJ3D
disposeLocal, getSurfaceRender, setRayBasedRender, setSurfaceRender
-
Methods inherited from class gov.nih.mipav.view.renderer.JPanelRendererBase
buildApplyButton, buildCancelButton, buildCloseButton, buildHelpButton, buildOKButton, buildTitledBorder, focusGained, focusLost, isCancelled, itemStateChanged, keyPressed, keyReleased, keyTyped, makeString, setLeftHandSystem, setVisible, setVisibleStandard, setWCSystem, testParameter
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
LIGHT_INDEX_STATIC
public static final int LIGHT_INDEX_STATIC
Static light index.- See Also:
- Constant Field Values
-
LIGHT_INDEX_AMBIENT
public static final int LIGHT_INDEX_AMBIENT
Ambient light index.- See Also:
- Constant Field Values
-
LIGHT_INDEX_MODEL_X0Y0Z0
public static final int LIGHT_INDEX_MODEL_X0Y0Z0
light for corner X0Y0Z0.- See Also:
- Constant Field Values
-
LIGHT_INDEX_MODEL_X1Y0Z0
public static final int LIGHT_INDEX_MODEL_X1Y0Z0
light for corner X1Y0Z0.- See Also:
- Constant Field Values
-
LIGHT_INDEX_MODEL_X0Y1Z0
public static final int LIGHT_INDEX_MODEL_X0Y1Z0
light for corner X0Y1Z0.- See Also:
- Constant Field Values
-
LIGHT_INDEX_MODEL_X1Y1Z0
public static final int LIGHT_INDEX_MODEL_X1Y1Z0
light for corner X1Y1Z0.- See Also:
- Constant Field Values
-
LIGHT_INDEX_MODEL_X0Y0Z1
public static final int LIGHT_INDEX_MODEL_X0Y0Z1
light for corner X0Y0Z1.- See Also:
- Constant Field Values
-
LIGHT_INDEX_MODEL_X1Y0Z1
public static final int LIGHT_INDEX_MODEL_X1Y0Z1
light for corner X1Y0Z1.- See Also:
- Constant Field Values
-
LIGHT_INDEX_MODEL_X0Y1Z1
public static final int LIGHT_INDEX_MODEL_X0Y1Z1
light for corner X0Y1Z1.- See Also:
- Constant Field Values
-
LIGHT_INDEX_MODEL_X1Y1Z1
public static final int LIGHT_INDEX_MODEL_X1Y1Z1
light for corner X1Y1Z1.- See Also:
- Constant Field Values
-
LIGHT_INDEX_MAX
public static final int LIGHT_INDEX_MAX
Max number of light.- See Also:
- Constant Field Values
-
ambientRadio
private javax.swing.JRadioButton ambientRadio
Radio button for different light type.
-
bNeedsRedraw
private boolean bNeedsRedraw
Flag is set if one of the controls changed a value and the renderering needs to be redrawn when the mouse is released.
-
checkBoxShowLight
private javax.swing.JCheckBox checkBoxShowLight
Check box to show the light bulb or not.
-
colorButton
private javax.swing.JButton colorButton
Color button, checkBox On/Off.
-
colorChooser
private ViewJColorChooser colorChooser
Color choose dialog reference.
-
colorLabel
private javax.swing.JLabel colorLabel
Color label.
-
controlPanel
private javax.swing.JPanel controlPanel
Control panel.
-
controlPanelBox
private javax.swing.Box controlPanelBox
Control panel box that hold the control panel.
-
directionalRadio
private javax.swing.JRadioButton directionalRadio
Directional light radio botton.
-
drawPanel
private javax.swing.JPanel drawPanel
Scroll panel reference.
-
intensitySlider
private javax.swing.JSlider intensitySlider
Intensity slider.
-
iSelect
private int iSelect
index of currently selected one.
-
labelIntensity
private javax.swing.JLabel labelIntensity
Light intensity label.
-
labelIntensityBegin
private javax.swing.JLabel labelIntensityBegin
Light intensity label begin.
-
labelIntensityEnd
private javax.swing.JLabel labelIntensityEnd
Light intensity label end.
-
labelIntensityMid
private javax.swing.JLabel labelIntensityMid
Light intensity label middle.
-
labelShininess
private javax.swing.JLabel labelShininess
Light shinness label.
-
labelShininessBegin
private javax.swing.JLabel labelShininessBegin
Shinness label begin.
-
labelShininessEnd
private javax.swing.JLabel labelShininessEnd
Shinness label end.
-
labelShininessMid
private javax.swing.JLabel labelShininessMid
Shinness lable middle.
-
list
private javax.swing.JList list
List of lights.
-
m_aiLightScale
private int[] m_aiLightScale
Light scale factor array.
-
m_akLights
private GeneralLight[] m_akLights
The structure for the light bulbs.
-
m_akModelLights
private GeneralLight[] m_akModelLights
General light array.
-
m_akSoftwareLightsModel
private SoftwareLight[] m_akSoftwareLightsModel
Soft light array.
-
m_akSoftwareLightsWorld
private SoftwareLight[] m_akSoftwareLightsWorld
Lighting objects needed for software rendering.
-
m_akWorldLights
private GeneralLight[] m_akWorldLights
World general light array.
-
m_kLabelPosX
private javax.swing.JLabel m_kLabelPosX
Label for slider X position.
-
m_kLabelPosY
private javax.swing.JLabel m_kLabelPosY
Label for slider Y position.
-
m_kLabelPosZ
private javax.swing.JLabel m_kLabelPosZ
Label for slider Z position.
-
m_kLabelTrgX
private javax.swing.JLabel m_kLabelTrgX
Label for X light target position.
-
m_kLabelTrgY
private javax.swing.JLabel m_kLabelTrgY
Label for Y light target position.
-
m_kLabelTrgZ
private javax.swing.JLabel m_kLabelTrgZ
Label for Z light target position.
-
m_kPanelSurface
private JPanelSurface m_kPanelSurface
surface panel reference.
-
m_kRenderSurface
private SurfaceRender m_kRenderSurface
Parent render frame reference.
-
m_kSliderPosX
private javax.swing.JSlider m_kSliderPosX
Light x position slider.
-
m_kSliderPosY
private javax.swing.JSlider m_kSliderPosY
Light y position slider.
-
m_kSliderPosZ
private javax.swing.JSlider m_kSliderPosZ
Light z position slider.
-
m_kSliderTrgX
private javax.swing.JSlider m_kSliderTrgX
Light x target position slider.
-
m_kSliderTrgY
private javax.swing.JSlider m_kSliderTrgY
Light y target position slider.
-
m_kSliderTrgZ
private javax.swing.JSlider m_kSliderTrgZ
Light z target position slider.
-
m_kTextPosX
private javax.swing.JTextField m_kTextPosX
X position text field.
-
m_kTextPosY
private javax.swing.JTextField m_kTextPosY
Y position text field.
-
m_kTextPosZ
private javax.swing.JTextField m_kTextPosZ
Z position text field.
-
m_kTextTrgX
private javax.swing.JTextField m_kTextTrgX
X target position text field.
-
m_kTextTrgY
private javax.swing.JTextField m_kTextTrgY
Y target position text field.
-
m_kTextTrgZ
private javax.swing.JTextField m_kTextTrgZ
Z target position text field.
-
onOffCheckBox
private javax.swing.JCheckBox onOffCheckBox
Light turn on/off check box.
-
onOffLabel
private javax.swing.JLabel onOffLabel
Light turn on/off label.
-
pointRadio
private javax.swing.JRadioButton pointRadio
Point light radio button.
-
scroller
private javax.swing.JScrollPane scroller
Scroll pane.
-
scrollPanel
private javax.swing.JPanel scrollPanel
Scroll the control panel when the frame changes size.
-
shininessPanel
private javax.swing.JPanel shininessPanel
Shininess panel.
-
shininessSlider
private javax.swing.JSlider shininessSlider
Shininess slider.
-
spotRadio
private javax.swing.JRadioButton spotRadio
Spot light radio button.
-
textIntensity
private javax.swing.JTextField textIntensity
Light intensity textfield.
-
textShininess
private javax.swing.JTextField textShininess
Light shinness textfield.
-
xBox
private float xBox
x, y, z box size.
-
yBox
private float yBox
x, y, z box size.
-
zBox
private float zBox
x, y, z box size.
-
maxBox
private float maxBox
x, y, z box size.
-
m_kGPUVolumeRender
private VolumeTriPlanarRender m_kGPUVolumeRender
-
-
Constructor Detail
-
JPanelLights
public JPanelLights(JPanelSurface kPanelSurface, SurfaceRender kRenderSurface)
Constructor.- Parameters:
kPanelSurface- JPanelSurface Reference to the panel which contains the surface view. This may be a null reference to indicate that there is no corresponding surface view panel.kRenderSurface- SurfaceRender Reference to view which contains the surface rendered view.
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
Changes color of slices box frame and button if color button was pressed; turns bounding box on and off if checkbox was pressed; and closes dialog if "Close" button was pressed.- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener- Specified by:
actionPerformedin classJPanelRendererBase- Parameters:
event- Event that triggered function.
-
disposeLocal
public void disposeLocal(boolean flag)
Clear memory and garbage collection.- Parameters:
flag- call super dispose or not
-
getGeneralLight
public GeneralLight getGeneralLight(int iIndex)
The the general light with the given index.- Parameters:
iIndex- light index- Returns:
- GeneralLight general light model.
-
getGeneralLights
public GeneralLight[] getGeneralLights()
Returns all general lights.- Returns:
- GeneralLight[] general light model.
-
getMainPanel
public javax.swing.JPanel getMainPanel()
Get the main control Panel.- Specified by:
getMainPanelin classJPanelRendererBase- Returns:
- mainPanel main control panel
-
getNumLights
public int getNumLights()
Get the number of lights.- Returns:
- int max light number
-
getSoftwareLightsModel
public SoftwareLight[] getSoftwareLightsModel()
Get the software light model.- Returns:
- SoftwareLight[] array of the software light.
-
getSoftwareLightsWorld
public SoftwareLight[] getSoftwareLightsWorld()
Get the software light world.- Returns:
- SoftwareLight[] array of the software light world.
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent event)
Unchanged.- Specified by:
mouseClickedin interfacejava.awt.event.MouseListener- Parameters:
event- Original mouse event.
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent event)
Unchanged.- Specified by:
mouseEnteredin interfacejava.awt.event.MouseListener- Parameters:
event- Original mouse event.
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent event)
Unchanged.- Specified by:
mouseExitedin interfacejava.awt.event.MouseListener- Parameters:
event- Original mouse event.
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent event)
Unchanged.- Specified by:
mousePressedin interfacejava.awt.event.MouseListener- Parameters:
event- Original mouse event.
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent event)
Used in MouseRecorder to stop one series of slide moves.- Specified by:
mouseReleasedin interfacejava.awt.event.MouseListener- Parameters:
event- Original mouse event.
-
refreshLighting
public void refreshLighting()
Repaints the parent frame with the correct lighting.
-
resizePanel
public void resizePanel(int panelWidth, int frameHeight)Resizig the control panel with ViewJFrameVolumeView's frame width and height.- Overrides:
resizePanelin classJPanelRendererBase- Parameters:
panelWidth- widthframeHeight- height
-
setSelectedIndex
public void setSelectedIndex(int index)
Sets the light to selected.- Parameters:
index- Index of light
-
stateChanged
public void stateChanged(javax.swing.event.ChangeEvent e)
Slider move event handler.- Specified by:
stateChangedin interfacejavax.swing.event.ChangeListener- Parameters:
e- Slider move events
-
updateSoftwareLights
public void updateSoftwareLights()
Get the current SoftwareLight instances from each of the GeneralLight instances -- for the world- and model-based lights.
-
valueChanged
public void valueChanged(javax.swing.event.ListSelectionEvent kEvent)
Sets values of sliders and intensities appropriately based on which light was chosen in the list.- Specified by:
valueChangedin interfacejavax.swing.event.ListSelectionListener- Parameters:
kEvent- Event that triggered this function.
-
finalize
protected void finalize() throws java.lang.ThrowableCalls dispose.- Overrides:
finalizein classJPanelRendererBase- Throws:
java.lang.Throwable- throw exception.
-
addControlPanel
private void addControlPanel(javax.swing.JPanel panelControl, java.awt.Component c, java.awt.GridBagConstraints gbc, int x, int y, int w, int h)Helper method that adds components to the control panel for the grid bag layout.- Parameters:
panelControl- control panel reference.c- Component added to the control panel.gbc- GridBagConstraints of added component.x- Gridx locationy- Gridy locationw- Gridwidthh- Gridheight
-
buildControlPanel
private void buildControlPanel()
Build the light control panel.
-
buildListPanel
private void buildListPanel()
Build the light list panel.
-
buildShininessPanel
private void buildShininessPanel()
Build the shinness control panel.
-
createLabel
private javax.swing.JLabel createLabel(java.lang.String title, boolean bEnable)Creates a label in the proper font and color.- Parameters:
title- The title of the label.bEnable- True if label is to be enabled.- Returns:
- The new label.
-
refreshControlPanel
public void refreshControlPanel()
Refresh the light control panel.
-
enableLight
public void enableLight(int iSelect, boolean bOn)
-
-