sgtplot.beans
Class Panel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- sgtplot.beans.Panel
-
- All Implemented Interfaces:
- java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, LayerControl
public class Panel extends javax.swing.JComponent implements LayerControl
ALayercontainer that provides aStackedLayoutof theLayers.- Since:
- 3.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Field Summary
-
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor and Description Panel(PanelHolder ph)Panelconstructor withPanelHolderargument.Panel(java.lang.String name)Panelconstructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddData(SGTData data, Attribute attr, DataGroup dataGroup, Legend legend)Add data to thisPanelandDataGroup.voiddraw(java.awt.Graphics g)voiddraw(org.freehep.graphics2d.VectorGraphics g)Used internally by sgtplot.voiddrawDraggableItems(org.freehep.graphics2d.VectorGraphics g)Used internally by sgtplot.DataGroupLayerfindDataGroupLayer(java.lang.String id)FindDataGroupLayerinPanel.java.lang.StringgetId()Get the identifier for thePanelLayergetLayer(java.lang.String id)GetLayerfrom thisPanel.LayergetLayerFromDataId(java.lang.String id)GetLayerfrom thisPanel.java.lang.ObjectgetObjectAt(int x, int y, boolean check)Find object associated with a MOUSE_DOWN event.java.lang.Object[]getObjectsAt(int x, int y, boolean check)Find objects associated with a MOUSE_DOWN event.JPanegetPane()Get theJPanethePanelis associated with.booleanhasLayer(java.lang.String id)Does thisPanelcontain this Layer?booleanisDataInPanel(java.lang.String id)Checks to see if a data id matches that data attached to theGraph.voidresetZoom()Reset the zoom for allDataGroupLayers in thisPanel.voidsetClipping(boolean clip)Set clipping forDataGroupLayers in thisPanel.voidsetPane(AbstractPane pane)Set thePanethePanelis associated with.voidsetPanelHolder(PanelHolder ph)SetPanelHolder.java.lang.StringtoString()Get aStringrepresentation of theLayer.voidupdate()Traverses thePanelHolderand adds any new objects and updates exisiting objects.-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, 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, getPeer, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Constructor Detail
-
Panel
public Panel(java.lang.String name)
Panelconstructor.PanelHolderwill need to be set.- Parameters:
name- Panel name
-
Panel
public Panel(PanelHolder ph)
Panelconstructor withPanelHolderargument.Panelname set fromPanelHolderidentifier.- Parameters:
ph- PanelHolder
-
-
Method Detail
-
setPanelHolder
public void setPanelHolder(PanelHolder ph)
SetPanelHolder.PanelHoldercontains the layout information andDataGroups associated with thePanel.- Parameters:
ph- PanelHolder
-
update
public void update()
Traverses thePanelHolderand adds any new objects and updates exisiting objects.
-
getObjectAt
public java.lang.Object getObjectAt(int x, int y, boolean check)Find object associated with a MOUSE_DOWN event. The getObjectAt method scans through all the objects associated with the Panel to find one whose bounding box contains the mouse location. This method should not be called by a user.- Parameters:
x- mouse coordinatey- mouse coordinatecheck- if true requires that object isSelectable- Returns:
- object at location
-
resetZoom
public void resetZoom()
Reset the zoom for allDataGroupLayers in thisPanel.
-
setClipping
public void setClipping(boolean clip)
Set clipping forDataGroupLayers in thisPanel.- Parameters:
clip- if true clip data to bounds.
-
hasLayer
public boolean hasLayer(java.lang.String id)
Does thisPanelcontain this Layer?- Parameters:
id- layer identification- Returns:
- true, if Layer is in Panel
-
getLayer
public Layer getLayer(java.lang.String id)
GetLayerfrom thisPanel. Returnsnullif Layer is not found.- Parameters:
id- Layer identifier- Returns:
- Layer
-
isDataInPanel
public boolean isDataInPanel(java.lang.String id)
Checks to see if a data id matches that data attached to theGraph.- Parameters:
id- data identifier- Returns:
- true if data is in Panel
-
getLayerFromDataId
public Layer getLayerFromDataId(java.lang.String id)
GetLayerfrom thisPanel. Returnsnullif Layer is not found.- Parameters:
id- SGTData identifier- Returns:
- Layer
-
getObjectsAt
public java.lang.Object[] getObjectsAt(int x, int y, boolean check)Find objects associated with a MOUSE_DOWN event. The getObjecstAt method scans through all the objects associated with the Panel to find those whose bounding box contains the mouse location. This method should not be called by a user.- Parameters:
x- mouse coordinatey- mouse coordinatecheck- if selectable- Returns:
- object array
-
findDataGroupLayer
public DataGroupLayer findDataGroupLayer(java.lang.String id)
FindDataGroupLayerinPanel.- Parameters:
id- DataGroupLayer identifier- Returns:
- DataGroupLayer
-
getPane
public JPane getPane()
Get theJPanethePanelis associated with.- Returns:
- Refence to the
Pane
-
setPane
public void setPane(AbstractPane pane)
Set thePanethePanelis associated with. This method is called byPanewhen thePane.addmethod is exectued.- Specified by:
setPanein interfaceLayerControl- Parameters:
pane- ThePane
-
draw
public void draw(java.awt.Graphics g) throws PaneNotFoundException- Throws:
PaneNotFoundException
-
drawDraggableItems
public void drawDraggableItems(org.freehep.graphics2d.VectorGraphics g) throws PaneNotFoundExceptionDescription copied from interface:LayerControlUsed internally by sgtplot.- Specified by:
drawDraggableItemsin interfaceLayerControl- Parameters:
g- Graphics object.- Throws:
PaneNotFoundException- Pane not found.
-
addData
public void addData(SGTData data, Attribute attr, DataGroup dataGroup, Legend legend) throws DataTargetMismatchException
Add data to thisPanelandDataGroup. legend can benull.- Parameters:
data- SGTData to be addedattr- AttributedataGroup- DataGroup to add data tolegend- Lenged for data- Throws:
DataTargetMismatchException
-
getId
public java.lang.String getId()
Get the identifier for thePanel- Specified by:
getIdin interfaceLayerControl- Returns:
- identifier/name
-
toString
public java.lang.String toString()
Get aStringrepresentation of theLayer.- Overrides:
toStringin classjava.awt.Component- Returns:
Stringrepresentation
-
draw
public void draw(org.freehep.graphics2d.VectorGraphics g) throws PaneNotFoundExceptionDescription copied from interface:LayerControlUsed internally by sgtplot.- Specified by:
drawin interfaceLayerControl- Parameters:
g- Graphics object- Throws:
PaneNotFoundException- Pane not found.
-
-
DMelt 3.0 © DataMelt by jWork.ORG