sgtplot.swing
Class JGraphicLayout
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JLayeredPane
-
- sgtplot.JPane
-
- sgtplot.swing.JGraphicLayout
-
- All Implemented Interfaces:
- java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, java.io.Serializable, javax.accessibility.Accessible, javax.swing.Scrollable, AbstractPane
- Direct Known Subclasses:
- JLineProfileLayout, JPlotLayout
public abstract class JGraphicLayout extends JPane
JGraphicLayoutis a abstract class that provides the basis for pre-defined layouts using theCartesianGraphclass.JGraphicLayoutextendsJPane.- Since:
- 2.0
- See Also:
CartesianGraph,JPlotLayout, Serialized Form
-
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field and Description javax.swing.JMenuItemm_editjavax.swing.JMenuItemm_resetstatic intX_AXISUse X array fromSGTData.static intY_AXISUse Y array fromSGTData.static intZ_AXISUse Z array fromSGTData.-
Fields inherited from class javax.swing.JLayeredPane
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER
-
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface sgtplot.AbstractPane
BOTTOM, CENTER, DEFAULT_SCALE, LEFT, MIDDLE, RIGHT, SHRINK_TO_FIT, SPECIFIED_LOCATION, TO_FIT, TOP
-
-
Constructor Summary
Constructors Constructor and Description JGraphicLayout()JGraphicLayout(java.lang.String id, java.awt.Image img)JGraphicLayoutconstructor.JGraphicLayout(java.lang.String id, java.awt.Image img, java.awt.Dimension size)JGraphicLayoutconstructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidaddAttribute(SGTData data, Attribute attr)AssociateSGTDatawith anAttribute.voidaddData(SGTData data)Add data to the layout.abstract voidaddData(SGTData data, java.lang.String label)Add data to the plotvoidaddPropertyChangeListener(java.beans.PropertyChangeListener l)Add a PropertyChangeListener to the list.voidaddVetoableChangeListener(java.beans.VetoableChangeListener l)AttributefindAttribute(java.lang.String id)Find anAttributegiven an id.Range2DfindRange(SGTGrid data, GridAttribute attr, int dir)Find the range of theSGTGridobject in the specified direction.Range2DfindRange(SGTLine data, int dir)Find the range of theSGTLineobject in the specific direction.SoTRangefindSoTRange(SGTGrid data, GridAttribute attr, int dir)Find the range of theSGTGridobject in the specified direction.SoTRangefindSoTRange(SGTLine line, int dir)Find the range of theSGTLineobject in the specific direction.SoTRangefindSoTRange(SGTVector data, int dir)Find the range of theSGTVectorobject in the specified direction.TimeRangefindTimeRange(SGTGrid data, GridAttribute attr)Find theTimeRangeof theSGTGridobject.TimeRangefindTimeRange(SGTLine data)Find the time range of theSGTLineobject.doublefromUserX(double Xpic, Range2D x)doublefromUserY(double Ypic, Range2D y)AttributegetAttribute(SGTData data)Find anAttributegiven aSGTDataobject.intgetBaseUnit()Get the base unitsCollectiongetData()Return data associated with the plot.java.awt.ImagegetIconImage()Get icon imagejava.lang.StringgetId()Get the identifierabstract Rectangle2D.DoublegetKeyBoundsP()Get the bounds for the line or color key.Dimension2DgetKeyLayerSizeP()Get the size of the key layer in physical coordinates.JPanegetKeyPane()Get KeyPane objectabstract java.lang.StringgetLocationSummary(SGTData grid)Construct a string that summarizes the location of the data.DomaingetRange()Get the currentDomainDomaingetZoomBoundsU()Get the zoom bounds in user unitsbooleanisClipping()Returns true if clipping is on.booleanisEditClasses()Aresgtplotobjects editable?booleanisKeyPane()Is there a key pane?booleanisOverlayed()Layer overlay flag.voidremovePropertyChangeListener(java.beans.PropertyChangeListener l)Remove the PropertyChangeListener from the list.voidremoveVetoableChangeListener(java.beans.VetoableChangeListener l)abstract voidresetZoom()Set the axes to the range of theSGTDataobjects.voidsetBaseUnit(int base)Set the base units.voidsetClipping(boolean clip)Set clipping on or off.voidsetEditClasses(boolean b)Enablesgtplotobject property editingvoidsetId(java.lang.String id)Set the identifierabstract voidsetKeyBoundsP(Rectangle2D.Double r)Set the bounds for the line or color key.voidsetKeyLayerSizeP(Dimension2D d)Set the size of the key layer in physical coordinates.voidsetOverlayed(boolean over)Set flag to overlay the layers.abstract voidsetRange(Domain domain)Set the axes to to range specified by theDomainobject.voidsetTitles(java.lang.String title, java.lang.String title2, java.lang.String title3)Set the plot titles.voidshowMenuEdit()doubletoUserX(double Xpic, Range2D x)doubletoUserY(double Ypic, Range2D y)-
Methods inherited from class sgtplot.JPane
add, add, add, add, add, draw, draw, draw, draw, draw, draw, drawPage, getComponent, getFirstLayer, getLayer, getLayerFromDataId, getMaximumSize, getMinimumSize, getObjectAt, getObjectsAt, getObjectsAt, getPageHAlign, getPageOrigin, getPageScaleMode, getPageSize, getPageVAlign, getPreferredScrollableViewportSize, getPreferredSize, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedObject, getStrokeDrawer, getVersion, getZoomBounds, getZoomStart, init, isBatch, isModified, isMouseEventsEnabled, isPrinter, moveLayerDown, moveLayerDown, moveLayerUp, moveLayerUp, paintComponent, print, processMouseEvent, processMouseMotionEvent, setBatch, setBatch, setModified, setMouseEventsEnabled, setPageAlign, setPageHAlign, setPageOrigin, setPageScaleMode, setPageVAlign, setScrollableBlockIncrement, setScrollableUnitIncrement, setSelectedObject, setSize, toString
-
Methods inherited from class javax.swing.JLayeredPane
getAccessibleContext, getComponentCountInLayer, getComponentsInLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getPosition, highestLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, putLayer, remove, removeAll, setLayer, setLayer, setPosition
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, 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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, 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
addContainerListener, 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, 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, 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, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface sgtplot.AbstractPane
getBounds
-
-
-
-
Field Detail
-
X_AXIS
public static final int X_AXIS
Use X array fromSGTData.- See Also:
- Constant Field Values
-
Y_AXIS
public static final int Y_AXIS
Use Y array fromSGTData.- See Also:
- Constant Field Values
-
Z_AXIS
public static final int Z_AXIS
Use Z array fromSGTData.- See Also:
- Constant Field Values
-
m_edit
public javax.swing.JMenuItem m_edit
-
m_reset
public javax.swing.JMenuItem m_reset
-
-
Constructor Detail
-
JGraphicLayout
public JGraphicLayout()
-
JGraphicLayout
public JGraphicLayout(java.lang.String id, java.awt.Image img)JGraphicLayoutconstructor.- Parameters:
id- identifierimg- icon image- See Also:
JPlotLayout
-
JGraphicLayout
public JGraphicLayout(java.lang.String id, java.awt.Image img, java.awt.Dimension size)JGraphicLayoutconstructor.- Parameters:
id- identifierimg- icon imagesize- graph size in device units- See Also:
JPlotLayout
-
-
Method Detail
-
setId
public void setId(java.lang.String id)
Set the identifier- Specified by:
setIdin interfaceAbstractPane- Overrides:
setIdin classJPane- Parameters:
id- layout identifier
-
getId
public java.lang.String getId()
Get the identifier- Specified by:
getIdin interfaceAbstractPane- Overrides:
getIdin classJPane- Returns:
- layout identifier
-
setTitles
public void setTitles(java.lang.String title, java.lang.String title2, java.lang.String title3)Set the plot titles.- Parameters:
title- main plot titletitle2- secondary plot titletitle3- tertiary plot title
-
setBaseUnit
public void setBaseUnit(int base)
Set the base units. The base units are set automatically based on the firstSGTDataadded to the list. OtherSGTDataobjects added thereafter will be converted to the standard display units for each base unit type. (TEMPERATURE, default units are "degC"; VELOCITY, default units are "m/s"; DISTANCE, default unis are "m"). NOTE: Presently the units supported are very limited.- See Also:
Units.NONE,Units.TEMPERATURE,Units.VELOCITY,Units.DISTANCE
-
getBaseUnit
public int getBaseUnit()
Get the base units- Returns:
- the current base units for the layout
-
setOverlayed
public void setOverlayed(boolean over)
Set flag to overlay the layers.- Parameters:
over- if true overlay layers if false stack
-
isOverlayed
public boolean isOverlayed()
Layer overlay flag.- Returns:
- true if layers will be overlayed
-
getIconImage
public java.awt.Image getIconImage()
Get icon image- Returns:
- icon image
-
getKeyPane
public JPane getKeyPane()
Get KeyPane object- Returns:
- pane
-
isKeyPane
public boolean isKeyPane()
Is there a key pane?
-
addData
public void addData(SGTData data)
Add data to the layout. Where data is added is dependent on the specific layout. Additional layers will be created as required.- Parameters:
data- data to be added
-
addAttribute
public void addAttribute(SGTData data, Attribute attr)
AssociateSGTDatawith anAttribute. The associations are managed by aHashtableobject.
-
getAttribute
public Attribute getAttribute(SGTData data) throws DataNotFoundException
Find anAttributegiven aSGTDataobject.- Throws:
DataNotFoundException
-
findAttribute
public Attribute findAttribute(java.lang.String id)
Find anAttributegiven an id.- Since:
- 3.0
-
addData
public abstract void addData(SGTData data, java.lang.String label)
Add data to the plot
-
getLocationSummary
public abstract java.lang.String getLocationSummary(SGTData grid)
Construct a string that summarizes the location of the data.
-
findRange
public Range2D findRange(SGTLine data, int dir)
Find the range of theSGTLineobject in the specific direction.- Parameters:
data- SGTLine objectdir- direction- See Also:
CartesianGraph
-
findSoTRange
public SoTRange findSoTRange(SGTLine line, int dir)
Find the range of theSGTLineobject in the specific direction.- Parameters:
data- SGTLine objectdir- direction- Returns:
- range as an
SoTRangeobject - See Also:
CartesianGraph
-
findSoTRange
public SoTRange findSoTRange(SGTVector data, int dir)
Find the range of theSGTVectorobject in the specified direction. Uses the U component to find X, Y ranges.- Parameters:
data- the data vectordir- the direction- Returns:
- range as an
SoTRangeobject
-
findSoTRange
public SoTRange findSoTRange(SGTGrid data, GridAttribute attr, int dir)
Find the range of theSGTGridobject in the specified direction.- Parameters:
data- the data gridattr- the grid attributedir- the direction- Returns:
- range as an
SoTRangeobject
-
findRange
public Range2D findRange(SGTGrid data, GridAttribute attr, int dir)
Find the range of theSGTGridobject in the specified direction.- Parameters:
data- the data gridattr- the grid attributedir- the direction
-
showMenuEdit
public void showMenuEdit()
-
findTimeRange
public TimeRange findTimeRange(SGTLine data)
Find the time range of theSGTLineobject.- Parameters:
data- SGTLine object- See Also:
CartesianGraph
-
findTimeRange
public TimeRange findTimeRange(SGTGrid data, GridAttribute attr)
Find theTimeRangeof theSGTGridobject.- Parameters:
data- the data gridattr- the grid attributedir- the direction
-
setClipping
public void setClipping(boolean clip)
Set clipping on or off. If clipping is on, clip to the axes range.- Parameters:
clip- true if clipping is on
-
isClipping
public boolean isClipping()
Returns true if clipping is on.- Returns:
- true if clipping is on
-
resetZoom
public abstract void resetZoom()
Set the axes to the range of theSGTDataobjects.
-
setRange
public abstract void setRange(Domain domain) throws java.beans.PropertyVetoException
Set the axes to to range specified by theDomainobject.- Throws:
java.beans.PropertyVetoException
-
getRange
public Domain getRange()
Get the currentDomain
-
getZoomBoundsU
public Domain getZoomBoundsU()
Get the zoom bounds in user units
-
toUserX
public double toUserX(double Xpic, Range2D x)
-
fromUserX
public double fromUserX(double Xpic, Range2D x)
-
fromUserY
public double fromUserY(double Ypic, Range2D y)
-
toUserY
public double toUserY(double Ypic, Range2D y)
-
getData
public Collection getData()
Return data associated with the plot.- Returns:
- data in a
Collection
-
setEditClasses
public void setEditClasses(boolean b)
Enablesgtplotobject property editing
-
isEditClasses
public boolean isEditClasses()
Aresgtplotobjects editable?
-
getKeyBoundsP
public abstract Rectangle2D.Double getKeyBoundsP()
Get the bounds for the line or color key.
-
setKeyBoundsP
public abstract void setKeyBoundsP(Rectangle2D.Double r)
Set the bounds for the line or color key.
-
getKeyLayerSizeP
public Dimension2D getKeyLayerSizeP()
Get the size of the key layer in physical coordinates.
-
setKeyLayerSizeP
public void setKeyLayerSizeP(Dimension2D d)
Set the size of the key layer in physical coordinates.
-
addVetoableChangeListener
public void addVetoableChangeListener(java.beans.VetoableChangeListener l)
- Overrides:
addVetoableChangeListenerin classjavax.swing.JComponent
-
removeVetoableChangeListener
public void removeVetoableChangeListener(java.beans.VetoableChangeListener l)
- Overrides:
removeVetoableChangeListenerin classjavax.swing.JComponent
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface:AbstractPaneAdd a PropertyChangeListener to the list. Properties forPaneandJPaneinclude "objectSelected" and "zoomRectangle".- Specified by:
addPropertyChangeListenerin interfaceAbstractPane- Overrides:
addPropertyChangeListenerin classJPane
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface:AbstractPaneRemove the PropertyChangeListener from the list.- Specified by:
removePropertyChangeListenerin interfaceAbstractPane- Overrides:
removePropertyChangeListenerin classJPane
-
-
DMelt 3.0 © DataMelt by jWork.ORG