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.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
FieldsModifier and TypeFieldDescriptionprotected TransferHandler
protected G2dComponent
protected JPanel
protected static final GridBagConstraints
protected static PopupPlotCreator
protected static final int
protected static final int
protected JPanel
static final int
Constants for getting Axis Labelsstatic final int
static final int
static final int
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
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Adds the legend containers to the panel.protected void
addLegendToPosition
(LegendPanel legend, int position) void
void
addPlotObject
(G2dObject obj) addPlotObjectvoid
addPlotObject
(G2dObject go, G2dLineProperties lineProp, boolean refreshComponents) addPlotObjectprotected void
addPopupWindow
(G2dDialog dialog) void
addScaleToTable
(String key, Scale scl) Simple assistant method that adds a scale to the table of existing scale.protected void
addTool
(ToolbarButtonProp bprop) public method for adding a plot tool and buttonvoid
void
buildComponents
(PlotLayout plotLayout) void
buildComponents
(List objvec) Creates a two pane 2D drawing area to display a set of G2dObjects with default colorsvoid
buildComponents
(List objvec, boolean addToolbar, boolean addLegend) void
buildComponents
(List objvec, List colorvec) void
buildComponents
(List objvec, List colorvec, boolean addToolbar, boolean addLegend) Creates a two pane 2D drawing area to display a set of G2dObjectsvoid
Creates 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 longvoid
Removes all scales, axis, and componentsvoid
configurePanel
(G2dPanelProp prop) configure the panel based on a G2dPanelProp objectprotected Axis
createAxis
(int type, String name) void
createDefaultMapToolsprotected G2dMouseAdapter
static ViewportToolbarProp
protected G2dDialog
Opens the plot into a G2dDialog, if it is not already in one already.protected Scale
createScale
(String scaleName) protected JPopupMenu
protected Viewport
protected void
fireObjectSelectionChangedgetAxisLabel
(int axis) getAxisTics
(int axis) Gets all the components in this container that satisfy the predicateint
Returns 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[]
double
int
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.int
This 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 PopupPlotCreator
getPropertiesScale[]
int
public 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 Viewportsboolean
boolean
boolean
boolean
boolean
isPaintEnabledboolean
boolean
mouseDragged
(LocalPt pt) Method called when the mouse is dragged.void
moveLegendToPosition
(int position) This method will move the legend from on position on the panel to another.boolean
objectPopupMenu
(LocalPt pt, int modifiers) Test to see if an object popupmenu can be handled at the given local point.boolean
objectSelect
(LocalPt pt, int modifiers) objectSelectvoid
void
paintGfx()
paintGfxvoid
Method that is repsonsible for paint the plot component on the panel.void
void
pointerOver
(LocalPt pt) pointerOverint
print
(Graphics g, PageFormat pageFormat, int pageIndex) int
print
(Graphics g, PageFormat pageFormat, int pageIndex, boolean useLocalPageFormat, PrintProperties printProperties) void
printStatus
(String txt) printStatusstatic void
registerPopupPlotCreator
(PopupPlotCreator creator) void
void
void
void
reset scales on all viewports in panelvoid
void
resetProperties
(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.void
setBounds
(int x, int y, int w, int h) Moves and resizes this component.void
void
setDeviceResolution
(int dpi) void
setDirty()
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.void
setDisplayUnitsSystem
(int units) Sets the current Unit System for this objectvoid
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.void
setIgnorePopupPlotEvents
(boolean b) void
setLabelFontSizes
(int sz, int tiny, int min, int max) set the font sizes for the axis labelsvoid
setLegendPanel
(LegendPanel panel) void
setLegendVisible
(boolean b) setMouseAdapter
(G2dMouseAdapter adapter) Set the active mouse adapter for the canvas.void
setMouseAdapter
(String className) Creates and makes current a mouse adapter according to the given class name.void
setPaintEnabled
(boolean b) setPaintEnabledvoid
setPlotObjects
(List plotvec) Set the plot objects with default line colorsvoid
setPlotObjects
(List plotvec, List colorvec) Set the plot objects with specific line colorsvoid
void
setSelectedToolbarButton
(int selected) void
setSize
(int w, int h) setSizevoid
setSizevoid
setTicFontSizes
(int sz, int tiny, int min, int max) set the font sizes for the axis labelsvoid
setTimeZone
(TimeZone tz) Sets the time zone that this component will use to display date and time.void
void
setTransferHandler
(TransferHandler transferHandler) void
setViewportAxisLink
(Viewport view, Axis axis, int axisId) void
Opens the plot into a G2dDialog, if it is not already in one already.void
showStatistics
(boolean stats) void
showThumbnailPopupMenu
(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.void
useLineStyles
(boolean useStyles) void
This method loops through all viewports zooming them so all data becomes visible.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, 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, 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:
setTransferHandler
in 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:
print
in 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
Vector
ofG2dLineProperties
-
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:
objectPopupMenu
in 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:
pointerOver
in 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:
objectSelect
in 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:
objectSelectionChanged
in interfaceObjectSelectionListener
-
addObjectSelectionListener
-
removeObjectSelectionListener
-
fireObjectSelectionChanged
fireObjectSelectionChanged- Parameters:
event
- parameter for fireObjectSelectionChanged
-
getMouseAdapter
getMouseAdapter- Specified by:
getMouseAdapter
in interfaceG2dToolbarListener
- Returns:
- the returned G2dMouseAdapter
-
setMouseAdapter
Creates and makes current a mouse adapter according to the given class name.- Specified by:
setMouseAdapter
in interfaceG2dToolbarListener
- Parameters:
className
-
-
createDefaultMouseAdapter
- Returns:
-
setMouseAdapter
Set the active mouse adapter for the canvas.- Specified by:
setMouseAdapter
in interfaceG2dToolbarListener
- Returns:
-
setDisplayUnitsSystem
public void setDisplayUnitsSystem(int units) Description copied from interface:UnitsComponent
Sets the current Unit System for this object- Specified by:
setDisplayUnitsSystem
in 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:
setDisplayScaleFactor
in interfaceUnitsComponent
- Parameters:
paramId
-scaleFactor
-
-
getDisplayUnitsString
Description copied from interface:UnitsComponent
This method allows the retrieves the units string for a given units system- Specified by:
getDisplayUnitsString
in interfaceUnitsComponent
- See Also:
-
setTimeZone
Description copied from interface:TimeZoneComponent
Sets the time zone that this component will use to display date and time.- Specified by:
setTimeZone
in interfaceTimeZoneComponent
- Parameters:
tz
- The time zone to use for display purposes
-
getTimeZone
Description copied from interface:TimeZoneComponent
Gets the Time Zone that this component is using to display a date and time.- Specified by:
getTimeZone
in interfaceTimeZoneComponent
- Returns:
- java.util.TimeZone
-
getSelectedToolbarButton
public int getSelectedToolbarButton()public access to toolbar button selection- Returns:
-
setSelectedToolbarButton
public void setSelectedToolbarButton(int selected) -
addFocusListener
- Overrides:
addFocusListener
in classComponent
-
removeFocusListener
- Overrides:
removeFocusListener
in classComponent
-
isFocusTraversable
public boolean isFocusTraversable()- Overrides:
isFocusTraversable
in 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()
-