Package hec.gfx2d
Class Viewport
- All Implemented Interfaces:
G2dEditComponent,G2dPointerComponent,G2dToolbarListener,G2dViewportEditComponent,G2dZoomComponent,ImageObserver,MenuContainer,Serializable,Observer,Accessible
public class Viewport
extends G2dComponent
implements Observer, G2dZoomComponent, G2dPointerComponent, G2dEditComponent, G2dViewportEditComponent
2d graphics drawing region.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class hec.gfx2d.G2dComponent
G2dComponent.DefaultPreferredSizeProvider, G2dComponent.EditPropertyListenerNested 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 booleanprotected BufferedImageprotected booleanprotected Vector<G2dMarkerLine>protected Vector<G2dMarkerPoint>Fields inherited from class hec.gfx2d.G2dComponent
_parent, _popupMenu, BOTTOM, LEFT, RIGHT, TOPFields 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, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAxisMarker(AxisMarkerDescription description) voidCreates a new Marker Line for the viewport by creating a glyph with the given Marker Properties.voidaddAxisMarker(String txt, int axis) Adds a Marker Line to the specified Axis - displays a dialog for the user to enter the value for the marker.voidAdds a Marker Line to the specified Axis - displays a dialog for the user to enter the value for the marker.voidCreates a new Marker Point for the viewport by creating a glyph with the given MarkerPoint Properties.voidaddComponentLayer(ViewportLayer<?> layer) voidvoidaddG2dGlyph(G2dGlyph glyph) voidaddG2dGlyph(G2dGlyph glyph, Scale scl) voidaddG2dObject(G2dObject obj) Adds a new G2dObject to the viewportvoidaddG2dObject(G2dObject obj, Scale scl) Adds a new G2dObject to the viewport for drawing.voidaddG2dObject(G2dObject obj, G2dLineProperties lineProp) voidaddG2dObject(G2dObject obj, G2dLineProperties[] lineProp) voidaddG2dObject(G2dObject obj, G2dLineProperties[] lineProp, Scale scl) voidaddG2dObject(G2dObject obj, G2dLineProperties lineProp, Scale scl) voidaddG2dObject(G2dObject obj, Color lc, Color fc) Adds a G2dObject to the viewport.voidaddG2dObject(G2dObject obj, Color lc, Color fc, Scale scl) voidaddG2dObjects(List g2dObjects, List lineProperties) voidaddG2dObjects(List g2dObjects, List lineProperties, boolean append) adds the list of g2dobjects to the viewport.voidaddGraphLabelItem(GfxTextObject textobj) Adds a feature to the MapTextObject attribute of the MapCanvas objectprotected voidvoidvoidAdds a new scale to the list of scale that this viewport owns.voidAdds a Marker Line to the XAxis - Displays the Marker Line Properties for the user to edit the properties of the markervoidaddXAxisMarker(double value) voidaddXAxisMarker(String value) voidAdds a Marker Line to the YAxis - Displays the Marker Line Properties for the user to edit the properties of the markervoidaddYAxisMarker(String value) voidvoidclearPlot(boolean reval) voidNotify glyphs to clear their selection list because the mouse adaptor has changedvoidbooleanprotected voidvoidvoidvoidvoidvoiddeleteMarkerPoint(G2dMarkerPoint markerPoint) voidvoidprotected ScalevoidfloatgetAlpha()get theAxisspecified byaxisNamefor this ViewportgetAxisLabel(String axisName) get theAxisLabelfor the axis specified byaxisNamefor this ViewportgetAxisTics(String axisName) get theAxisTicsfor the axis specified byaxisNamefor this Viewportget the background color for this Viewport as a Stringget the border color for this Viewport as a Colorget the border color for this Viewport as a Stringfloatget the border weight for this Viewportbooleanget the Fill Pattern for this Viewport as a StringgetGlyphForObject(G2dObject g2dObj) Returns the list of glyphs used by this viewportDeprecated.Deprecated.Deprecated.Deprecated.get the major grid X color for this Viewport as a Stringget the major grid X style for this Viewport as a Stringfloatreturn the Major X Grid Width for this Viewportget the major grid Y color for this Viewport as a Stringget the major grid Y style for this Viewport as a Stringfloatreturn the Major Y Grid Width for this ViewportfloatDeprecated.floatDeprecated.getMasterAxis(int axisType) get the minor grid X color for this Viewport as a Colorget the minor grid X color for this Viewport as a Stringget the minor grid X style for this Viewport as a Stringfloatreturn the Minor X Grid Width for this Viewportget the minor grid Y color for this Viewport as a Colorget the minor grid Y color for this Viewport as a Stringget the minor grid Y style for this Viewport as a Stringfloatreturn the Minor Y Grid Width for this ViewportfloatDeprecated.floatDeprecated.Returns the properties that define this viewportgetScale()Returns the scale used by this component.getScale(int i) get the Vector of ScalesReturns a tool tip text for the given mouse location.voidinsertG2dGlyph(G2dGlyph glyph, int ipos) voidinsertG2dGlyph(G2dGlyph glyph, Scale scl, int ipos) voidinsertG2dObjects(List g2dObjects, List lineProperties, int insertPosition) adds the list of g2dobjects to the viewport.booleanDeprecated.booleanreturn whether the background is drawn or notbooleanDeprecated.booleanreturn whether the border is drawn or notbooleanbooleanbooleanbooleanDeprecated.booleanreturn whether the Major X Grid is DrawnbooleanDeprecated.booleanreturn whether the Major Y Grid is DrawnbooleanDeprecated.booleanreturn whether the Minor X Grid is DrawnbooleanDeprecated.booleanreturn whether the Minor Y Grid is DrawnbooleanbooleanintbooleanobjectPopupMenu(LocalPt pt, int modifiers) Shows the popupmenu for the viewport if the viewport has some item of interest at a given point.booleanobjectSelect(LocalPt pt, int modifiers) Method called on left mouse click.protected voidpaintComponent(Graphics arg0) voidDraw viewport background and all glyphsvoidpointerOver(LocalPt pt) Method called when the pointer is over a given pointvoidvoidvoidResets all of the data limits to the bounds of the current data and grows the bounds if necessaryvoidresetAllDataLimits(boolean growRegionExtents) Resests all of the data limits to the bounds of the current data.voidresetDataLimits(Scale scl) voidresetDataLimits(Scale scl, boolean invalidateExtents) voidscaleAxisFromOpposite(String axisName) Causes the specified axis to be scaled such that the interval between the major tic marks follows the 1-2-5 rule and that the axis values at the major tic marks are whole multiples of the interval.voidsetAlpha(float alpha) voidsetAxisMarkers(List markers) voidset the background for this ViewportvoidsetBackground(String colorString) set the background to the color specified by colorStringvoidsetBackgroundVisible(boolean draw) set the background draw state for this ViewportvoidsetBorderColor(String borderColor) set the border color for this ViewportvoidsetBorderVisible(boolean draw) set the border draw state for this ViewportvoidsetBorderWeight(float borderWeight) set the border weight for this ViewportvoidsetBounds(int x, int y, int w, int h) voidsetDirty()Method that marks the viewport as dirty and needs to recompute its doubleBuffervoidsetDoubleBuffered(boolean b) voidsetDragEnabled(boolean b) voidDeprecated.voidDeprecated.voidDeprecated.voidDeprecated.voidsetDrawLegend(boolean draw) voidDeprecated.voidDeprecated.voidDeprecated.voidDeprecated.voidDeprecated.voidDeprecated.voidDeprecated.voidDeprecated.voidsetDrawViewportLegend(boolean draw) voidsetFillPattern(String pattern) set the fill pattern for this Viewportvoidset the X and Y grids to color specified by colorvoidsetGridColor(String colorString) set the X and Y grids to color specified by colorStringvoidDeprecated.voidDeprecated.voidset the major and minor X grids to colorvoidsetGridXColor(String colorString) set the major and minor X grids to colorStringvoidset the major and minor Y grids to colorvoidsetGridYColor(String colorString) set the major and minor Y grids to colorStringvoidsetLegendAlignment(String align) voidsetLegendRenderer(ViewportLegendRenderer renderer) Sets the legened renderer.voidvoidsetLogarithmic(String axisName) voidsetMajorGridXColor(String majorGridXColor) set the major grid X color for this ViewportvoidsetMajorGridXStyle(String majorGridXStyle) set the major grid X style for this ViewportvoidsetMajorGridXVisible(boolean draw) set the major X grid draw state for this ViewportvoidsetMajorGridXWidth(float gridLineWidth) set the major X Grid width for this ViewportvoidsetMajorGridYColor(String majorGridYColor) set the major Grid Y color for this ViewportvoidsetMajorGridYStyle(String majorGridYStyle) set the major grid Y style for this ViewportvoidsetMajorGridYVisible(boolean draw) set the major X grid draw state for this ViewportvoidsetMajorGridYWidth(float gridLineWidth) set the major Y Grid width for this ViewportvoidsetMajorXGridWidth(float gridLineWidth) Deprecated.voidsetMajorYGridWidth(float gridLineWidth) Deprecated.voidsetMasterAxis(int axisType, Axis axis) voidsetMasterAxisTable(Hashtable table) voidsetMinorGridXColor(String minorGridXColor) set the minor grid X color for this ViewportvoidsetMinorGridXStyle(String minorGridXStyle) set the minor grid X style for this ViewportvoidsetMinorGridXVisible(boolean draw) set the minor X grid draw state for this ViewportvoidsetMinorGridXWidth(float gridLineWidth) set the minor X Grid width for this ViewportvoidsetMinorGridYColor(String minorGridYColor) set the minor grid Y color for this ViewportvoidsetMinorGridYStyle(String minorGridYStyle) set the minor grid Y style for this ViewportvoidsetMinorGridYVisible(boolean draw) set the minor Y grid draw state for this ViewportvoidsetMinorGridYWidth(float gridLineWidth) set the minor Y Grid width for this ViewportvoidsetMinorXGridWidth(float gridLineWidth) Deprecated.voidsetMinorYGridWidth(float gridLineWidth) Deprecated.setMouseAdapter(G2dMouseAdapter adapter) Sets the mouse adapter for the component to the given mouse adapter.voidvoidsetShowStatistics(boolean showstats) voidsetTransferHandler(TransferHandler newHandler) toString()voidupdate(Observable o, Object arg) Observer method used to listen to changes in the AxisvoidvoidzoomByFactor(double factor) Defines a new zoom region by a given factorvoidSets the bounds of the new zoom regionMethods inherited from class hec.gfx2d.G2dComponent
getAlignment, getG2dPanel, getMouseAdapter, getPreferredSize, getPreferredSizeLocal, paint, paintGfx, paintGfx, setG2dPanel, setMouseAdapter, setPreferredSizeProviderMethods 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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isValidateRoot, paintBorder, paintChildren, 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, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, 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, 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, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface hec.gfx2d.G2dZoomComponent
getGraphics
-
Field Details
-
_markerLines
-
_markerPoints
-
_doubleBuffer
-
_dirtyBuffer
protected boolean _dirtyBuffer -
_isDoubleBuffer
protected boolean _isDoubleBuffer
-
-
Constructor Details
-
Viewport
public Viewport() -
Viewport
Default Constructor
-
-
Method Details
-
setTransferHandler
- Overrides:
setTransferHandlerin classJComponent
-
addComponentLayer
-
paintComponent
- Overrides:
paintComponentin classG2dComponent
-
addMouseListeners
protected void addMouseListeners() -
setDragEnabled
public void setDragEnabled(boolean b) -
isDragEnabled
public boolean isDragEnabled() -
setDoubleBuffered
public void setDoubleBuffered(boolean b) - Overrides:
setDoubleBufferedin classJComponent
-
isDoubleBuffered
public boolean isDoubleBuffered()- Overrides:
isDoubleBufferedin classJComponent
-
setDirty
public void setDirty()Method that marks the viewport as dirty and needs to recompute its doubleBuffer -
getToolTipText
Returns a tool tip text for the given mouse location. In this method we loop over the glyphs and see if they have any tool tips. The first one that has one is returned;- Overrides:
getToolTipTextin classG2dComponent
-
createPopupMenu
public void createPopupMenu()- Overrides:
createPopupMenuin classG2dComponent
-
createMenu
-
addXAxisMarker
public void addXAxisMarker()Adds a Marker Line to the XAxis - Displays the Marker Line Properties for the user to edit the properties of the marker -
addAxisMarker
Adds a Marker Line to the specified Axis - displays a dialog for the user to enter the value for the marker. -
addAxisMarkerPoint
public void addAxisMarkerPoint()Adds a Marker Line to the specified Axis - displays a dialog for the user to enter the value for the marker. -
addXAxisMarker
-
addYAxisMarker
-
addAxisMarker
-
removeGlyph
-
addXAxisMarker
public void addXAxisMarker(double value) -
addYAxisMarker
public void addYAxisMarker()Adds a Marker Line to the YAxis - Displays the Marker Line Properties for the user to edit the properties of the marker -
addAxisMarker
Creates a new Marker Line for the viewport by creating a glyph with the given Marker Properties.- Parameters:
prop- the properties to use to draw the marker line
-
addAxisPointMarker
Creates a new Marker Point for the viewport by creating a glyph with the given MarkerPoint Properties.- Parameters:
prop- the properties to use to draw the marker line
-
setAxisMarkers
-
getAxisMarkers
-
resetDataLimits
-
resetDataLimits
-
resetAllDataLimits
public void resetAllDataLimits()Resets all of the data limits to the bounds of the current data and grows the bounds if necessary -
resetAllDataLimits
public void resetAllDataLimits(boolean growRegionExtents) Resests all of the data limits to the bounds of the current data.- Parameters:
growRegionExtents- boolean true if the scale should grow to the larger extents, false if the scales should be set to the current bounds of the data.
-
clearPlot
public void clearPlot() -
clearPlot
public void clearPlot(boolean reval) -
findScale
-
addG2dObject
Adds a new G2dObject to the viewport- Parameters:
obj- the object to add and draw.
-
addG2dObject
Adds a new G2dObject to the viewport for drawing. A new glyph is created to hold the G2dObject and the glyph is added to the internal list of glyphs that are drawn when the paintGfx method is called.- Parameters:
obj- the object to addscl- the scale used to map the object data from world to local coordinates.
-
addG2dGlyph
-
addG2dGlyph
-
insertG2dGlyph
-
insertG2dGlyph
-
addG2dObject
Adds a G2dObject to the viewport. If a scale cannot be found for the G2dObject, the it is ignored.- Parameters:
obj- the data object to addlc- the line color used to draw the data linefc- the fill color used to draw the data line.
-
addG2dObject
-
addG2dObject
-
addG2dObject
-
addG2dObject
-
addG2dObject
-
addG2dObjects
-
addG2dObjects
adds the list of g2dobjects to the viewport.- Parameters:
g2dObjects- ListlineProperties- Listappend- boolean if true then appends to the end of the list. false prepends to the front of the list.
-
insertG2dObjects
adds the list of g2dobjects to the viewport.- Parameters:
g2dObjects- ListlineProperties- List
-
getGlyphVector
Description copied from interface:G2dViewportEditComponentReturns the list of glyphs used by this viewport- Specified by:
getGlyphVectorin interfaceG2dEditComponent- Specified by:
getGlyphVectorin interfaceG2dViewportEditComponent
-
update
Observer method used to listen to changes in the Axis -
addScale
Adds a new scale to the list of scale that this viewport owns.- Parameters:
scl- the scale to add. If null, it is ignored.
-
getScale
Description copied from interface:G2dViewportEditComponentReturns the scale used by this component. Default is X1/Y1- Specified by:
getScalein interfaceG2dViewportEditComponent- Returns:
-
getScale
-
getScale
-
numScaleElements
public int numScaleElements() -
computeScaling
public void computeScaling() -
deleteMarkerLine
-
deleteMarkerPoint
- Parameters:
markerPoint-
-
deleteAllMarkerLines
public void deleteAllMarkerLines() -
deleteAllMarkerPoints
public void deleteAllMarkerPoints() -
drawMarkers
-
getVisibleArea
-
addGraphLabelItem
Adds a feature to the MapTextObject attribute of the MapCanvas object- Parameters:
textobj- The feature to be added to the MapTextObject attribute
-
setLegendRenderer
Sets the legened renderer. The renderer is responsible for drawing a customized legened on the viewport. Users may set their own renderer here if the "DefaultLegenedRenderer" is not suitable for their needs.- Parameters:
renderer-
-
paintGfx2
Draw viewport background and all glyphs- Parameters:
g- the graphics context to paint to.
-
zoomIn
Description copied from interface:G2dZoomComponentSets the bounds of the new zoom region- Specified by:
zoomInin interfaceG2dZoomComponent- Parameters:
rc- - the rectangle of the new zoom area in local coordinates
-
scaleAxisFromOpposite
Causes the specified axis to be scaled such that the interval between the major tic marks follows the 1-2-5 rule and that the axis values at the major tic marks are whole multiples of the interval. The interval and tic mark values of the opposite axis are not changed.- Parameters:
axisName- The name of the axis to scale ("X1", "X2", "Y1", or "Y2").
-
zoomByFactor
public void zoomByFactor(double factor) Description copied from interface:G2dZoomComponentDefines a new zoom region by a given factor- Specified by:
zoomByFactorin interfaceG2dZoomComponent
-
updateRatingAxisValues
public void updateRatingAxisValues() -
setBounds
public void setBounds(int x, int y, int w, int h) -
setGridColor
set the X and Y grids to color specified by colorString- Parameters:
colorString- the color to set the grids to
-
setGridColor
set the X and Y grids to color specified by color- Parameters:
c- the color to set the X and Y grids to
-
setGridYColor
set the major and minor Y grids to colorString- Parameters:
colorString- the color to set the Y grids to
-
setGridYColor
set the major and minor Y grids to color- Parameters:
c- the color to set the Y grids to
-
setGridXColor
set the major and minor X grids to colorString- Parameters:
colorString- the color to set the X grids to
-
setGridXColor
set the major and minor X grids to color- Parameters:
c- the color to set the X grids to
-
getMajorGridXColor
-
getMajorGridYColor
-
setMajorGridYColor
set the major Grid Y color for this Viewport- Parameters:
majorGridYColor- the grid color
-
getMajorGridYColorString
get the major grid Y color for this Viewport as a String- Returns:
- the major grid Y color String
-
setMinorGridYColor
set the minor grid Y color for this Viewport- Parameters:
minorGridYColor- the grid color
-
getMinorGridYColor
get the minor grid Y color for this Viewport as a Color- Returns:
- the minor grid Y color Color
-
getMinorGridYColorString
get the minor grid Y color for this Viewport as a String- Returns:
- the minor grid Y color String
-
setMajorGridXColor
set the major grid X color for this Viewport- Parameters:
majorGridXColor- the grid color
-
getMajorGridXColorString
get the major grid X color for this Viewport as a String- Returns:
- the major grid X color String
-
setMinorGridXColor
set the minor grid X color for this Viewport- Parameters:
minorGridXColor- the grid color
-
getMinorGridXColor
get the minor grid X color for this Viewport as a Color- Returns:
- the minor grid X color Color
-
getMinorGridXColorString
get the minor grid X color for this Viewport as a String- Returns:
- the minor grid X color String
-
setMajorGridXVisible
public void setMajorGridXVisible(boolean draw) set the major X grid draw state for this Viewport -
isMajorGridXVisible
public boolean isMajorGridXVisible()return whether the Major X Grid is Drawn- Returns:
- whether the Major X Grid is Drawn
-
setMajorGridYVisible
public void setMajorGridYVisible(boolean draw) set the major X grid draw state for this Viewport -
isMajorGridYVisible
public boolean isMajorGridYVisible()return whether the Major Y Grid is Drawn- Returns:
- whether the Major Y Grid is Drawn
-
setMinorGridXVisible
public void setMinorGridXVisible(boolean draw) set the minor X grid draw state for this Viewport- Parameters:
draw- true draw, false do not draw
-
isMinorGridXVisible
public boolean isMinorGridXVisible()return whether the Minor X Grid is Drawn- Returns:
- whether the Minor X Grid is Drawn
-
setMinorGridYVisible
public void setMinorGridYVisible(boolean draw) set the minor Y grid draw state for this Viewport- Parameters:
draw- true draw, false do not draw
-
isMinorGridYVisible
public boolean isMinorGridYVisible()return whether the Minor Y Grid is Drawn- Returns:
- whether the Minor Y Grid is Drawn
-
setMajorGridXWidth
public void setMajorGridXWidth(float gridLineWidth) set the major X Grid width for this Viewport- Parameters:
gridLineWidth- the grid line width
-
getMajorGridXWidth
public float getMajorGridXWidth()return the Major X Grid Width for this Viewport- Returns:
- the major X grid width
-
setMajorGridYWidth
public void setMajorGridYWidth(float gridLineWidth) set the major Y Grid width for this Viewport- Parameters:
gridLineWidth- the grid line width
-
getMajorGridYWidth
public float getMajorGridYWidth()return the Major Y Grid Width for this Viewport- Returns:
- the major Y grid width
-
setMinorGridXWidth
public void setMinorGridXWidth(float gridLineWidth) set the minor X Grid width for this Viewport- Parameters:
gridLineWidth- the grid line width
-
getMinorGridXWidth
public float getMinorGridXWidth()return the Minor X Grid Width for this Viewport- Returns:
- the minor X grid width
-
setMinorGridYWidth
public void setMinorGridYWidth(float gridLineWidth) set the minor Y Grid width for this Viewport- Parameters:
gridLineWidth- the grid line width
-
getMinorGridYWidth
public float getMinorGridYWidth()return the Minor Y Grid Width for this Viewport- Returns:
- the minor Y grid width
-
setMajorGridXStyle
set the major grid X style for this Viewport- Parameters:
majorGridXStyle- the grid style
-
getMajorGridXStyleString
get the major grid X style for this Viewport as a String- Returns:
- the major grid X style String
-
setMajorGridYStyle
set the major grid Y style for this Viewport- Parameters:
majorGridYStyle- the grid style
-
getMajorGridYStyleString
get the major grid Y style for this Viewport as a String- Returns:
- the major grid Y style String
-
setMinorGridXStyle
set the minor grid X style for this Viewport- Parameters:
minorGridXStyle- the grid style
-
getMinorGridXStyleString
get the minor grid X style for this Viewport as a String- Returns:
- the minor grid X style String
-
setMinorGridYStyle
set the minor grid Y style for this Viewport- Parameters:
minorGridYStyle- the grid style
-
getMinorGridYStyleString
get the minor grid Y style for this Viewport as a String- Returns:
- the minor grid Y style String
-
setBorderVisible
public void setBorderVisible(boolean draw) set the border draw state for this Viewport -
isBorderVisible
public boolean isBorderVisible()return whether the border is drawn or not- Returns:
- whether the border is drawn
-
setBorderWeight
public void setBorderWeight(float borderWeight) set the border weight for this Viewport- Parameters:
borderWeight- the border weight
-
getBorderWeight
public float getBorderWeight()get the border weight for this Viewport- Returns:
- the border weight
-
getBorderColor
get the border color for this Viewport as a Color- Returns:
- the border color for this Viewport as a Color
-
getBorderColorString
get the border color for this Viewport as a String- Returns:
- the border color for this Viewport as a String
-
setBorderColor
set the border color for this Viewport- Parameters:
borderColor- the border color- See Also:
-
setFillPattern
set the fill pattern for this Viewport- Parameters:
pattern- the fill pattern- See Also:
-
getFillPatternString
get the Fill Pattern for this Viewport as a String- Returns:
- the fill pattern string
- See Also:
-
setBackgroundVisible
public void setBackgroundVisible(boolean draw) set the background draw state for this Viewport -
isBackgroundVisible
public boolean isBackgroundVisible()return whether the background is drawn or not- Returns:
- whether the background is drawn or not
-
setAlpha
public void setAlpha(float alpha) -
getAlpha
public float getAlpha() -
setBackground
set the background to the color specified by colorString- Parameters:
colorString- the string representation of a color. "red" or "255,255,0"
-
setBackground
set the background for this Viewport- Overrides:
setBackgroundin classJComponent- Parameters:
c- the background color
-
getBackground
- Overrides:
getBackgroundin classComponent
-
getBackgroundString
get the background color for this Viewport as a String- Returns:
- the background color string
-
getGlyphAtPoint
-
objectPopupMenu
Shows the popupmenu for the viewport if the viewport has some item of interest at a given point.- Specified by:
objectPopupMenuin interfaceG2dEditComponent- Specified by:
objectPopupMenuin interfaceG2dPointerComponent- Overrides:
objectPopupMenuin classG2dComponent- Parameters:
pt- the place where the popup menu should be displayedmodifiers- these are the modifiers from the original mouse click- Returns:
- true if the menu was shown, otherwise false.
-
pointerOver
Description copied from interface:G2dPointerComponentMethod called when the pointer is over a given point- Specified by:
pointerOverin interfaceG2dEditComponent- Specified by:
pointerOverin interfaceG2dPointerComponent- Overrides:
pointerOverin classG2dComponent- Parameters:
pt- - the point in which the pointer is over
-
objectSelect
Description copied from interface:G2dPointerComponentMethod called on left mouse click.- Specified by:
objectSelectin interfaceG2dPointerComponent- Parameters:
pt- the point to place the popup menu;modifiers- mouse modifiers that were recieved by the mouse adapter that may be usefull here.- Returns:
- true if the object select event was accepted and consumed otherwise false.
-
clearSelection
public void clearSelection()Notify glyphs to clear their selection list because the mouse adaptor has changed -
setMouseAdapter
Description copied from class:G2dComponentSets the mouse adapter for the component to the given mouse adapter. The component must implement the interface for that specific mouse adapter otherwise the adapter is ignored.- Specified by:
setMouseAdapterin interfaceG2dToolbarListener- Overrides:
setMouseAdapterin classG2dComponent
-
setDrawViewportLegend
public void setDrawViewportLegend(boolean draw) -
getDrawViewportLegend
public boolean getDrawViewportLegend() -
setLegendAlignment
-
setProperties
-
getProperties
Returns the properties that define this viewport -
editProperties
public void editProperties()- Overrides:
editPropertiesin classG2dComponent
-
addObjectSelectionListener
-
fireObjectSelectionChanged
-
getMasterAxis
-
setMasterAxisTable
-
setMasterAxis
-
isFocusTraversable
public boolean isFocusTraversable()- Overrides:
isFocusTraversablein classComponent
-
isRequestFocusEnabled
public boolean isRequestFocusEnabled()- Overrides:
isRequestFocusEnabledin classJComponent
-
addFocusListener
- Overrides:
addFocusListenerin classComponent
-
removeFocusListener
- Overrides:
removeFocusListenerin classComponent
-
toString
-
getAxisLabel
get theAxisLabelfor the axis specified byaxisNamefor this Viewport- Parameters:
axisName- the axis name. a case insensitive string of containing one of four values"x1","x2","y1"or"y2"- Returns:
- the AxisLabel or null if the axis doesn't exist or axisName is invalid
-
getAxisTics
get theAxisTicsfor the axis specified byaxisNamefor this Viewport- Parameters:
axisName- the axis name. a case insensitive string of containing one of four values"x1","x2","y1"or"y2"- Returns:
- the AxisTics or null if the axis doesn't exist or axisName is invalid
-
setLinear
-
setLogarithmic
-
getAxis
get theAxisspecified byaxisNamefor this Viewport- Parameters:
axisName- the axis name. a case insensitive string of containing one of four values"x1","x2","y1"or"y2"- Returns:
- the Axis or null if the axis doesn't exist or axisName is invalid
-
getScaleVector
get the Vector of Scales- Returns:
- the Scale Vector
-
setShowStatistics
public void setShowStatistics(boolean showstats) -
isShowingStatistics
public boolean isShowingStatistics() -
containsStatistics
public boolean containsStatistics() -
getGridColorX
Deprecated. -
getGridColorY
Deprecated. -
getGridXColorString
Deprecated. -
getGridYColorString
Deprecated. -
setGridColorY
Deprecated. -
setGridColorX
Deprecated. -
setDrawMajorXGridOn
Deprecated. -
setDrawMajorXGridOff
Deprecated. -
isMajorGridXDrawn
Deprecated. -
setDrawMajorYGridOn
Deprecated. -
setDrawMajorYGridOff
Deprecated. -
isMajorGridYDrawn
Deprecated. -
setDrawMinorXGridOn
Deprecated. -
setDrawMinorXGridOff
Deprecated. -
isMinorGridXDrawn
Deprecated. -
setDrawMinorYGridOn
Deprecated. -
setDrawMinorYGridOff
Deprecated. -
isMinorGridYDrawn
Deprecated. -
setMajorXGridWidth
Deprecated. -
getMajorXGridWidth
Deprecated. -
setMajorYGridWidth
Deprecated. -
getMajorYGridWidth
Deprecated. -
setMinorXGridWidth
Deprecated. -
getMinorXGridWidth
Deprecated. -
setMinorYGridWidth
Deprecated. -
getMinorYGridWidth
Deprecated. -
setDrawBorderOn
Deprecated. -
setDrawBorderOff
Deprecated. -
isBorderDrawn
Deprecated. -
setDrawBackgroundOn
Deprecated. -
setDrawBackgroundOff
Deprecated. -
isBackgroundDrawn
Deprecated. -
getGlyphForObject
-
setDrawLegend
public void setDrawLegend(boolean draw)
-