Package hec.gfx2d
Class G2dPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
hec.gfx2d.G2dPanel
- All Implemented Interfaces:
G2dPointerComponent,G2dToolbarListener,ObjectSelectionListener,ImageObserver,MenuContainer,Printable,Serializable,EventListener,Accessible,TimeZoneComponent,UnitsComponent
- Direct Known Subclasses:
G2dBarPlot,HotPlotPanel
public class G2dPanel
extends JPanel
implements G2dPointerComponent, G2dToolbarListener, UnitsComponent, TimeZoneComponent, ObjectSelectionListener, Printable
Copyright (C) 1997, 1998 Hydrologic Engineering Center,
United States Army Corps of Engineers, All Rights Reserved
HEC-Java NEXGEN
Version 1.0beta
The primary container for 2d graphic displays.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected TransferHandlerprotected G2dComponentprotected JPanelprotected static final GridBagConstraintsprotected static PopupPlotCreatorprotected static final intprotected static final intprotected JPanelstatic final intConstants for getting Axis Labelsstatic final intstatic final intstatic final intFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidAdds the legend containers to the panel.protected voidaddLegendToPosition(LegendPanel legend, int position) voidvoidaddPlotObject(G2dObject obj) addPlotObjectvoidaddPlotObject(G2dObject go, G2dLineProperties lineProp, boolean refreshComponents) addPlotObjectprotected voidaddPopupWindow(G2dDialog dialog) voidaddScaleToTable(String key, Scale scl) Simple assistant method that adds a scale to the table of existing scale.protected voidaddTool(ToolbarButtonProp bprop) public method for adding a plot tool and buttonvoidvoidbuildComponents(PlotLayout plotLayout) voidbuildComponents(List objvec) Creates a two pane 2D drawing area to display a set of G2dObjects with default colorsvoidbuildComponents(List objvec, boolean addToolbar, boolean addLegend) voidbuildComponents(List objvec, List colorvec) voidbuildComponents(List objvec, List colorvec, boolean addToolbar, boolean addLegend) Creates a two pane 2D drawing area to display a set of G2dObjectsvoidCreates a two pane 2D drawing area with axis tics and labels, scrollbars, title, and legend.buildPlotComponents(int plotcol, int plotrow, double colwgt, double rowwgt, int colwth, int rowht, Axis[] x, Axis[] y, Scale[] vs, boolean[] showXtic, boolean[] showXlabel, boolean showXscroll, boolean[] showYtic, boolean[] showYlabel, boolean showYscroll) Constructs a viewport component and associated componentsbuildPlotComponents(int plotcol, int plotrow, double colwgt, double rowwgt, Axis[] x, Axis[] y, Scale[] vs, boolean[] showXtic, boolean[] showXlabel, boolean showXscroll, boolean[] showYtic, boolean[] showYlabel, boolean showYscroll) builds a viewport that is one row tall and one column longvoidRemoves all scales, axis, and componentsvoidconfigurePanel(G2dPanelProp prop) configure the panel based on a G2dPanelProp objectprotected AxiscreateAxis(int type, String name) voidcreateDefaultMapToolsprotected G2dMouseAdapterstatic ViewportToolbarPropprotected G2dDialogOpens the plot into a G2dDialog, if it is not already in one already.protected ScalecreateScale(String scaleName) protected JPopupMenuprotected Viewportprotected voidfireObjectSelectionChangedgetAxisLabel(int axis) getAxisTics(int axis) Gets all the components in this container that satisfy the predicateintReturns the resolution of the current device being drawn to.getDisplayUnitsString(int v) This method allows the retrieves the units string for a given units systemstatic Color[]doubleintReturns the value used by the panels to determine the amount of space between the top and the bottom of viewports.If the value is -1 then the spacing is computed automatically based on font size.intThis returns an integer locations of the position of the legendstatic Color[]return a copy of the G2dLineProperties objects from all the viewports.getMouseAdapterReturns the plot layout used to construct this plot.Returns a vector of G2dObjects that are used in the plot by recursing over the viewports and querying them for their G2dObjects.static PopupPlotCreatorgetPropertiesScale[]intpublic access to toolbar button selectionGets the Time Zone that this component is using to display a date and time.getTitle()getViewportAxis(Viewport view, int axis) Returns the Axis for a given viewport.The axis can either be one of the master X-Y axis (X1 or Y1) or the slave axis (X2 or Y2).getViewportAxisLabel(Viewport view, int axisInt) Returns the Axis label for a given viewport.The axis label can either be one of the master X-Y axis (X1 or Y1) or the slave axis (X2 or Y2).getViewportAxisLabelSpacer(Viewport view, int axis) Returns the Axis Label for a given viewport.The axis label can either be one of the master X-Y axis (X1 or Y1) or the slave axis (X2 or Y2).If the viewport does not exist or there is no label for the viewport then null is returnedgetViewportAxisTics(Viewport view, int axis) Returns the Axis Tics for a given viewport.The axis tics can either be one of the master X-Y axis (X1 or Y1) or the slave axis (X2 or Y2).getViewportAxisTicsSpacer(Viewport view, int axis) Returns the Axis Spacer for a given viewport.The axis spacer can either be one of the master X-Y axis (X1 or Y1) or the slave axis (X2 or Y2).If the viewport does not exist or there is no label for the viewport then null is returnedViewport[]Returns an array of viewports.get the Vector of ViewportsbooleanbooleanbooleanbooleanbooleanisPaintEnabledbooleanbooleanmouseDragged(LocalPt pt) Method called when the mouse is dragged.voidmoveLegendToPosition(int position) This method will move the legend from on position on the panel to another.booleanobjectPopupMenu(LocalPt pt, int modifiers) Test to see if an object popupmenu can be handled at the given local point.booleanobjectSelect(LocalPt pt, int modifiers) objectSelectvoidvoidpaintGfx()paintGfxvoidMethod that is repsonsible for paint the plot component on the panel.voidvoidpointerOver(LocalPt pt) pointerOverintprint(Graphics g, PageFormat pageFormat, int pageIndex) intprint(Graphics g, PageFormat pageFormat, int pageIndex, boolean useLocalPageFormat, PrintProperties printProperties) voidprintStatus(String txt) printStatusstatic voidregisterPopupPlotCreator(PopupPlotCreator creator) voidvoidvoidvoidreset scales on all viewports in panelvoidvoidresetProperties(G2dPanelProp panelProperties) Resets the properties for the panel.It removes all currently visble glyphs, and all components and re-configures the panel according to the properties and then redraws the glyphs.voidsetBounds(int x, int y, int w, int h) Moves and resizes this component.voidvoidsetDeviceResolution(int dpi) voidsetDirty()voidsetDisplayScaleFactor(int paramId, double scaleFactor) Sets a scaling factor for a particular id.If any of the data used that parameter id it will be scaled accordingly.voidsetDisplayUnitsSystem(int units) Sets the current Unit System for this objectvoidsetHorizontalViewportSpacing(int pixelWidth) Sets the spacing in pixels between the top and bottom of viewports.If the value is -1 then the spacing is determined automatically by font size.voidsetIgnorePopupPlotEvents(boolean b) voidsetLabelFontSizes(int sz, int tiny, int min, int max) set the font sizes for the axis labelsvoidsetLegendPanel(LegendPanel panel) voidsetLegendVisible(boolean b) setMouseAdapter(G2dMouseAdapter adapter) Set the active mouse adapter for the canvas.voidsetMouseAdapter(String className) Creates and makes current a mouse adapter according to the given class name.voidsetPaintEnabled(boolean b) setPaintEnabledvoidsetPlotObjects(List plotvec) Set the plot objects with default line colorsvoidsetPlotObjects(List plotvec, List colorvec) Set the plot objects with specific line colorsvoidvoidsetSelectedToolbarButton(int selected) voidsetSize(int w, int h) setSizevoidsetSizevoidsetTicFontSizes(int sz, int tiny, int min, int max) set the font sizes for the axis labelsvoidsetTimeZone(TimeZone tz) Sets the time zone that this component will use to display date and time.voidvoidsetTransferHandler(TransferHandler transferHandler) voidsetViewportAxisLink(Viewport view, Axis axis, int axisId) voidOpens the plot into a G2dDialog, if it is not already in one already.voidshowStatistics(boolean stats) voidshowThumbnailPopupMenu(Component parent, int x, int y) Shows the popup menu for thumbnail plots that all the user to open the thumbnail plot into a full window plot.voiduseLineStyles(boolean useStyles) voidThis method loops through all viewports zooming them so all data becomes visible.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods 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, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, 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, 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, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
X1
public static final int X1Constants for getting Axis Labels- See Also:
-
X2
public static final int X2- See Also:
-
Y1
public static final int Y1- See Also:
-
Y2
public static final int Y2- See Also:
-
MAX_COMPONENT_ROW
protected static final int MAX_COMPONENT_ROW- See Also:
-
MAX_COMPONENT_COLUMN
protected static final int MAX_COMPONENT_COLUMN- See Also:
-
LEGEND_CONTAINER_GRIDBAGCONSTRAINTS
-
VERTICAL_LEGEND_CONTAINER
-
HORIZONTAL_LEGEND_CONTAINER
-
ACCESSORY_PANEL_CONTAINER
-
_transferHandler
-
m_popupPlotCreator
-
-
Constructor Details
-
G2dPanel
public G2dPanel()Default Constructor
-
-
Method Details
-
registerPopupPlotCreator
-
setPropertiesFactoryName
-
getPopupPlotCreator
-
setDirty
public void setDirty() -
getAccessoryPanel
-
setDeviceResolution
public void setDeviceResolution(int dpi) -
getDeviceResoultion
public int getDeviceResoultion()Returns the resolution of the current device being drawn to. If- Returns:
- int
-
createPopupPlot
Opens the plot into a G2dDialog, if it is not already in one already.- Returns:
-
addPopupWindow
-
removeGlyph
-
showThumbnailPopupMenu
Shows the popup menu for thumbnail plots that all the user to open the thumbnail plot into a full window plot.- Parameters:
parent-x- the x coordinate to show the menuy- the y coordinate to show the menu.
-
createThumbnailPopupMenu
-
addThumbnailMenuItems
-
showPopupPlot
public void showPopupPlot()Opens the plot into a G2dDialog, if it is not already in one already. -
setIgnorePopupPlotEvents
public void setIgnorePopupPlotEvents(boolean b) -
ignorePopupPlotEvent
public boolean ignorePopupPlotEvent() -
getViewports
Returns an array of viewports. If there are no viewports in the panel, and array of size 0 is returned.- Returns:
- the array of viewports.
-
setTransferHandler
- Overrides:
setTransferHandlerin classJComponent
-
getViewportToolbar
-
isPaintEnabled
public boolean isPaintEnabled()isPaintEnabled- Returns:
- the returned boolean
-
setPaintEnabled
public void setPaintEnabled(boolean b) setPaintEnabled- Parameters:
b- parameter for setPaintEnabled
-
addLegendToPosition
-
moveLegendToPosition
public void moveLegendToPosition(int position) This method will move the legend from on position on the panel to another.- Parameters:
position- marks the legend position. The valid positions are G2dPanelProp.BOTTOM and G2dPanelProp.RIGHT. The LEFT and TOP values will positiong to RIGHT and BOTTOM respectively.
-
paintGfx
public void paintGfx()paintGfx -
print
- Specified by:
printin interfacePrintable- Throws:
PrinterException
-
print
public int print(Graphics g, PageFormat pageFormat, int pageIndex, boolean useLocalPageFormat, PrintProperties printProperties) throws PrinterException - Throws:
PrinterException
-
getFontScl
public double getFontScl() -
resetFontScl
public void resetFontScl() -
setBounds
-
setBounds
public void setBounds(int x, int y, int w, int h) Moves and resizes this component. The new location of the top-left corner is specified by x and y, and the new size is specified by width and height. -
setSize
setSize -
setSize
public void setSize(int w, int h) setSize -
printStatus
printStatus- Parameters:
txt- parameter for printStatus
-
clearPanel
public void clearPanel()Removes all scales, axis, and components -
addScaleToTable
Simple assistant method that adds a scale to the table of existing scale. The scale can then be looked up via the key at any time.- Parameters:
key-scl-
-
getPlotLayout
Returns the plot layout used to construct this plot. If the plot was constructed using something other than PlotLayout than this will return null.- Returns:
-
buildComponents
-
createScale
-
buildDefaultComponents
public void buildDefaultComponents()Creates a two pane 2D drawing area with axis tics and labels, scrollbars, title, and legend. -
addLegendContainers
public void addLegendContainers()Adds the legend containers to the panel. -
getComponents
Gets all the components in this container that satisfy the predicateNote: This method should be called under AWT tree lock.
- Parameters:
p-- Returns:
- an array of all the components in this container.
- See Also:
-
applyToAll
-
buildComponents
Creates a two pane 2D drawing area to display a set of G2dObjects with default colors- Parameters:
objvec-
-
buildComponents
-
buildComponents
-
buildComponents
Creates a two pane 2D drawing area to display a set of G2dObjects- Parameters:
addLegend-
-
createAxis
-
getPlotObjects
Returns a vector of G2dObjects that are used in the plot by recursing over the viewports and querying them for their G2dObjects. If there are no objects then an empty vector is returned.- Returns:
- a vector of G2dObjects.
-
getLinePropertyObjects
return a copy of the G2dLineProperties objects from all the viewports. This returns the G2dLineProperties object in the same order asgetPlotObject()as long as the two methods are called with no changed to the plot layout between calls.- Returns:
- a
VectorofG2dLineProperties
-
getAllLinePropertyObjects
-
getProperties
getProperties- Returns:
- the returned G2dPanelProp
-
getLegendLocation
public int getLegendLocation()This returns an integer locations of the position of the legend- Returns:
- and integer value, eiter G2dPanelProp.BOTTOM or G2dPanel.RIGHT.
-
resetProperties
Resets the properties for the panel.It removes all currently visble glyphs, and all components and re-configures the panel according to the properties and then redraws the glyphs.- Parameters:
panelProperties-
-
configurePanel
configure the panel based on a G2dPanelProp object- Parameters:
prop-
-
getTitlePanel
-
getTitle
-
setTitle
-
setPlotObjects
Set the plot objects with default line colors- Parameters:
plotvec-
-
setPlotObjects
Set the plot objects with specific line colors- Parameters:
colorvec-
-
addPlotObject
addPlotObject- Parameters:
obj- parameter for addPlotObject
-
addPlotObject
addPlotObject- Parameters:
go- parameter for addPlotObjectlineProp- line properties that describe the g2dobject passed inrefreshComponents- if true the legend is refreshed.
-
plotTimeWindow
-
zoomToAll
public void zoomToAll()This method loops through all viewports zooming them so all data becomes visible. -
buildPlotComponents
public Viewport buildPlotComponents(int plotcol, int plotrow, double colwgt, double rowwgt, Axis[] x, Axis[] y, Scale[] vs, boolean[] showXtic, boolean[] showXlabel, boolean showXscroll, boolean[] showYtic, boolean[] showYlabel, boolean showYscroll) builds a viewport that is one row tall and one column long- Returns:
-
createViewport
-
buildPlotComponents
public Viewport buildPlotComponents(int plotcol, int plotrow, double colwgt, double rowwgt, int colwth, int rowht, Axis[] x, Axis[] y, Scale[] vs, boolean[] showXtic, boolean[] showXlabel, boolean showXscroll, boolean[] showYtic, boolean[] showYlabel, boolean showYscroll) Constructs a viewport component and associated components- Parameters:
plotcol-plotrow-colwgt-rowwgt-colwth-rowht-x-y-vs-showXtic-showXlabel-showXscroll-showYtic-showYlabel-showYscroll-- Returns:
-
getHorizontalViewportSpacing
public int getHorizontalViewportSpacing()Returns the value used by the panels to determine the amount of space between the top and the bottom of viewports.If the value is -1 then the spacing is computed automatically based on font size.- Returns:
-
setHorizontalViewportSpacing
public void setHorizontalViewportSpacing(int pixelWidth) Sets the spacing in pixels between the top and bottom of viewports.If the value is -1 then the spacing is determined automatically by font size.- Parameters:
pixelWidth-
-
createDefaultMapTools
createDefaultMapTools- Parameters:
tools- parameter for createDefaultMapTools
-
addTool
public method for adding a plot tool and button- Returns:
-
setViewportAxisLink
-
getViewportAxis
Returns the Axis for a given viewport.The axis can either be one of the master X-Y axis (X1 or Y1) or the slave axis (X2 or Y2). If the viewport does not exist or there is no label for the viewport then null is returned- Returns:
-
getViewportAxisLabel
Returns the Axis label for a given viewport.The axis label can either be one of the master X-Y axis (X1 or Y1) or the slave axis (X2 or Y2). If the viewport does not exist or there is no label for the viewport then null is returned- Parameters:
view-axisInt-- Returns:
-
getViewportAxisLabelSpacer
Returns the Axis Label for a given viewport.The axis label can either be one of the master X-Y axis (X1 or Y1) or the slave axis (X2 or Y2).If the viewport does not exist or there is no label for the viewport then null is returned- Parameters:
view-- Returns:
-
getViewportAxisTicsSpacer
Returns the Axis Spacer for a given viewport.The axis spacer can either be one of the master X-Y axis (X1 or Y1) or the slave axis (X2 or Y2).If the viewport does not exist or there is no label for the viewport then null is returned- Parameters:
view-- Returns:
-
getViewportAxisTics
Returns the Axis Tics for a given viewport.The axis tics can either be one of the master X-Y axis (X1 or Y1) or the slave axis (X2 or Y2). If the viewport does not exist or there is no label for the viewport then null is returned- Returns:
-
getAxisLabel
-
getAxisTics
-
setLabelFontSizes
public void setLabelFontSizes(int sz, int tiny, int min, int max) set the font sizes for the axis labels- Parameters:
max-
-
setTicFontSizes
public void setTicFontSizes(int sz, int tiny, int min, int max) set the font sizes for the axis labels- Parameters:
max-
-
resetAllDataLimits
public void resetAllDataLimits()reset scales on all viewports in panel -
paintGfx
Method that is repsonsible for paint the plot component on the panel. This is were all of the graphics drawing work is done, by looping over the components having them paint to there correct locations.- Parameters:
g- The graphics context to paint to
-
objectPopupMenu
Test to see if an object popupmenu can be handled at the given local point. If there is a popupmenu that can be shown then true is returned, otherwise false.- Specified by:
objectPopupMenuin interfaceG2dPointerComponent- Parameters:
pt- the point of where to put the popupMenu.modifiers- mouse modifiers that were recieved by the mouse adapter that may be usefull here.- Returns:
- true if the popup menu is shown.
-
pointerOver
pointerOver- Specified by:
pointerOverin interfaceG2dPointerComponent- Parameters:
pt- parameter for pointerOver
-
mouseDragged
Method called when the mouse is dragged.- Parameters:
pt- the new point of where the mouse was dragged to.- Returns:
- true if the mouse dragged event was accepted and consumed otherwise false.
-
objectSelect
objectSelect- Specified by:
objectSelectin interfaceG2dPointerComponent- Parameters:
pt- parameter for objectSelectmodifiers- mouse modifiers that were recieved by the mouse adapter that may be usefull here.- Returns:
- the returned boolean
-
objectSelectionChanged
- Specified by:
objectSelectionChangedin interfaceObjectSelectionListener
-
addObjectSelectionListener
-
removeObjectSelectionListener
-
fireObjectSelectionChanged
fireObjectSelectionChanged- Parameters:
event- parameter for fireObjectSelectionChanged
-
getMouseAdapter
getMouseAdapter- Specified by:
getMouseAdapterin interfaceG2dToolbarListener- Returns:
- the returned G2dMouseAdapter
-
setMouseAdapter
Creates and makes current a mouse adapter according to the given class name.- Specified by:
setMouseAdapterin interfaceG2dToolbarListener- Parameters:
className-
-
createDefaultMouseAdapter
- Returns:
-
setMouseAdapter
Set the active mouse adapter for the canvas.- Specified by:
setMouseAdapterin interfaceG2dToolbarListener- Returns:
-
setDisplayUnitsSystem
public void setDisplayUnitsSystem(int units) Description copied from interface:UnitsComponentSets the current Unit System for this object- Specified by:
setDisplayUnitsSystemin interfaceUnitsComponent
-
setDisplayScaleFactor
public void setDisplayScaleFactor(int paramId, double scaleFactor) Sets a scaling factor for a particular id.If any of the data used that parameter id it will be scaled accordingly.- Specified by:
setDisplayScaleFactorin interfaceUnitsComponent- Parameters:
paramId-scaleFactor-
-
getDisplayUnitsString
Description copied from interface:UnitsComponentThis method allows the retrieves the units string for a given units system- Specified by:
getDisplayUnitsStringin interfaceUnitsComponent- See Also:
-
setTimeZone
Description copied from interface:TimeZoneComponentSets the time zone that this component will use to display date and time.- Specified by:
setTimeZonein interfaceTimeZoneComponent- Parameters:
tz- The time zone to use for display purposes
-
getTimeZone
Description copied from interface:TimeZoneComponentGets the Time Zone that this component is using to display a date and time.- Specified by:
getTimeZonein interfaceTimeZoneComponent- Returns:
- java.util.TimeZone
-
getSelectedToolbarButton
public int getSelectedToolbarButton()public access to toolbar button selection- Returns:
-
setSelectedToolbarButton
public void setSelectedToolbarButton(int selected) -
addFocusListener
- Overrides:
addFocusListenerin classComponent
-
removeFocusListener
- Overrides:
removeFocusListenerin classComponent
-
isFocusTraversable
public boolean isFocusTraversable()- Overrides:
isFocusTraversablein classComponent
-
useLineStyles
public void useLineStyles(boolean useStyles) -
getScales
-
getViewportVector
get the Vector of Viewports- Returns:
- the Viewport Vector.
-
getLineColors
-
getFillColors
-
getLegendPanel
-
setLegendVisible
public void setLegendVisible(boolean b) -
isLegendVisible
public boolean isLegendVisible() -
setLegendPanel
-
createDefaultToolbarProperties
-
showStatistics
public void showStatistics(boolean stats) -
isShowingStatistics
public boolean isShowingStatistics() -
hasStatistics
public boolean hasStatistics()
-