Package draw
Class Plot3D
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
Class for a panel for a 3D scatter plot.
- Since:
- 2004.06.02
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
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
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 -
Method Summary
Modifier and TypeMethodDescriptionint
addPoint
(double x, double y, double z, int c) Add a colored point.void
build()
Build the scatter plot.void
build
(boolean rainbow) Build the scatter plot.void
clear()
Remove all stored points.Create an image of the panel contents.void
(Re)paint the 3D scatter plot panel.void
Remove all stored points.void
Reset the view of the panel.void
Set a color for an overlay value.void
setFOV
(double angle) Set the field of view (viewing angle) of the panel.void
setInset
(double inset) Set the inset percentage (for all axes).void
setLayout
(double offset, double size) Set the layout parameters for the labels.void
setMarker
(int size) Set the size of the markers.void
Set the label for the x-axis.void
Set the label for the y-axis.void
Set the label for the z-axis.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, 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, setVisible, 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
-
Constructor Details
-
Plot3D
public Plot3D()Create a panel for a 3D scatter plot.- Since:
- 2004.06.02 (Christian Borgelt)
-
-
Method Details
-
resetView
public void resetView()Reset the view of the panel.- Since:
- 2004.06.02 (Christian Borgelt)
-
setFOV
public void setFOV(double angle) Set the field of view (viewing angle) of the panel.- Parameters:
angle
- the field of view (viewing angle)- Since:
- 2004.06.02 (Christian Borgelt)
-
setLayout
public void setLayout(double offset, double size) Set the layout parameters for the labels.- Parameters:
offset
- the offset from the cube sidessize
- the size of the font- Since:
- 2004.06.02 (Christian Borgelt)
-
setXLabel
Set the label for the x-axis.- Parameters:
label
- the label for the x-axis- Since:
- 2004.06.03 (Christian Borgelt)
-
setYLabel
Set the label for the y-axis.- Parameters:
label
- the label for the y-axis- Since:
- 2004.06.03 (Christian Borgelt)
-
setZLabel
Set the label for the z-axis.- Parameters:
label
- the label for the z-axis- Since:
- 2004.06.03 (Christian Borgelt)
-
setInset
public void setInset(double inset) Set the inset percentage (for all axes).- Parameters:
inset
- the insert percentage- Since:
- 2014.01.27 (Christian Borgelt)
-
setMarker
public void setMarker(int size) Set the size of the markers.- Parameters:
size
- the size of the markers (in pixels)- Since:
- 2004.06.02 (Christian Borgelt)
-
clear
public void clear()Remove all stored points.- Since:
- 2004.06.02 (Christian Borgelt)
-
removeAllPoints
public void removeAllPoints()Remove all stored points.- Since:
- 2004.06.02 (Christian Borgelt)
-
addPoint
public int addPoint(double x, double y, double z, int c) Add a colored point.- Parameters:
x
- the x-coordinate of the pointy
- the y-coordinate of the pointz
- the z-coordinate of the pointc
- the color of the point- Returns:
- the index of the added point
- Since:
- 2004.06.02 (Christian Borgelt)
-
build
public void build()Build the scatter plot.- Since:
- 2004.06.05 (Christian Borgelt)
-
build
public void build(boolean rainbow) Build the scatter plot.- Parameters:
rainbow
- whe- Since:
- 2013.12.29 (Christian Borgelt)
-
setColor
Set a color for an overlay value.Colors can be set only after the scatter plot has been built.
- Parameters:
index
- the index of the color to setcolor
- the color to set- Since:
- 2004.06.02 (Christian Borgelt)
-
paint
(Re)paint the 3D scatter plot panel.- Overrides:
paint
in classJComponent
- Parameters:
g
- the graphics to use for the painting- Since:
- 2004.06.02 (Christian Borgelt)
-
makeImage
Create an image of the panel contents.- Returns:
- an image of the panel contents
- Since:
- 2007.02.07 (Christian Borgelt)
-