Package com.metsci.glimpse.core.plot
Class Plot2D
- java.lang.Object
-
- com.metsci.glimpse.core.layout.GlimpseLayout
-
- com.metsci.glimpse.core.layout.GlimpseAxisLayout2D
-
- com.metsci.glimpse.core.plot.Plot2D
-
- All Implemented Interfaces:
GlimpseTarget
,GlimpseKeyListener
,Keyable
,GlimpseMouseListener
,GlimpseMouseMotionListener
,GlimpseMouseWheelListener
,Mouseable
,GlimpsePainter
- Direct Known Subclasses:
MapPlot2D
,SimplePlot2D
public class Plot2D extends GlimpseAxisLayout2D
A simple, blank plotting area which divides itself into five regions:
- a central plotting area
- a title area above the plot
- a labeled horizontal x axis below the plot
- a labeled vertical y axis to the left of the plot
- a labeled vertical z axis to the right of the plot
Any of the areas above may be shown or hidden (the z axis area is commonly hidden).
This plot is commonly used as a template for building new plots, however for most use cases
SimplePlot2D
is more useful. It automatically provides useful painters such as grid lines and mouse cursors.- Author:
- ulman
- See Also:
SimplePlot2D
-
-
Field Summary
Fields Modifier and Type Field Description static int
BACKGROUND_LAYER
A constant for use withGlimpseLayout.setZOrder(com.metsci.glimpse.painter.base.GlimpsePainter, int)
.static int
DATA_LAYER
A constant for use withGlimpseLayout.setZOrder(com.metsci.glimpse.painter.base.GlimpsePainter, int)
.static int
FOREGROUND_LAYER
A constant for use withGlimpseLayout.setZOrder(com.metsci.glimpse.painter.base.GlimpsePainter, int)
.
-
Method Summary
-
Methods inherited from class com.metsci.glimpse.core.layout.GlimpseAxisLayout2D
clearCache, getAxis, getAxis, getAxis, getAxisFactory, isAxisFactorySet, isAxisSet, setAxis, setAxis, setAxis, setAxisFactory
-
Methods inherited from class com.metsci.glimpse.core.layout.GlimpseLayout
addLayout, addLayout, addLayout, addLayout, addLayout, addPainter, addPainter, addPainter, addPainter, addPainter, addPainter, dispose, getGlimpseKeyListeners, getGlimpseMouseListeners, getGlimpseMouseMotionListeners, getGlimpseMouseWheelListeners, getLayoutByKey, getLock, getName, getPainterByKey, getTargetBounds, getTargetChildren, invalidateLayout, isDisposed, isEventConsumer, isEventGenerator, isVisible, keyPressed, keyReleased, layoutTo, layoutTo, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, paintTo, removeAll, removeAllGlimpseListeners, removeAllLayouts, removeLayout, removeLayoutByKey, removePainter, removePainterByKey, setEventConsumer, setEventGenerator, setLayoutData, setLayoutManager, setLookAndFeel, setName, setVisible, setZOrder, setZOrder
-
-
-
-
Field Detail
-
BACKGROUND_LAYER
public static int BACKGROUND_LAYER
A constant for use withGlimpseLayout.setZOrder(com.metsci.glimpse.painter.base.GlimpsePainter, int)
. GlimpsePainters which should appear behind the plot data should be given this z order value.
-
DATA_LAYER
public static int DATA_LAYER
A constant for use withGlimpseLayout.setZOrder(com.metsci.glimpse.painter.base.GlimpsePainter, int)
. GlimpsePainters which contain plot data should generally be given this z order value. Note, this is the default z order.
-
FOREGROUND_LAYER
public static int FOREGROUND_LAYER
A constant for use withGlimpseLayout.setZOrder(com.metsci.glimpse.painter.base.GlimpsePainter, int)
. GlimpsePainters which contain overlays that should appear in front of plot data should be given this z order value.
-
-
Constructor Detail
-
Plot2D
public Plot2D(String name)
-
-
Method Detail
-
getLayoutManager
public GlimpseLayoutManagerMig getLayoutManager()
- Overrides:
getLayoutManager
in classGlimpseLayout
-
setBackgroundColor
public void setBackgroundColor(float[] color)
-
addAxisListener
public void addAxisListener(AxisListener2D l)
-
setUpdateModeZ
public void setUpdateModeZ(UpdateMode mode)
-
setUpdateModeXY
public void setUpdateModeXY(UpdateMode mode)
-
setAxisFont
public void setAxisFont(Font font)
-
setAxisFont
public void setAxisFont(Font font, boolean antialias)
-
setAxisColor
public void setAxisColor(float[] color)
-
setTitleFont
public void setTitleFont(Font font)
-
setTitleFont
public void setTitleFont(Font font, boolean antialias)
-
setTitle
public void setTitle(String title)
-
setTitleColor
public void setTitleColor(float[] rgba)
-
showTitle
public void showTitle(boolean show)
-
setBorderSize
public void setBorderSize(int size)
-
setAxisSizeX
public void setAxisSizeX(int size)
-
setAxisSizeY
public void setAxisSizeY(int size)
-
setAxisSizeZ
public void setAxisSizeZ(int size)
-
setTitleHeight
public void setTitleHeight(int size)
-
getAxis
public Axis2D getAxis()
- Overrides:
getAxis
in classGlimpseAxisLayout2D
-
getAxisX
public Axis1D getAxisX()
-
getAxisY
public Axis1D getAxisY()
-
getAxisZ
public Axis1D getAxisZ()
-
setTickSize
public void setTickSize(int size)
-
setTickColor
public void setTickColor(float[] color)
-
setTickLabelColor
public void setTickLabelColor(float[] color)
-
setAxisLabelColor
public void setAxisLabelColor(float[] color)
-
setMinorTickCount
public void setMinorTickCount(int count)
-
setShowMinorTicks
public void setShowMinorTicks(boolean show)
-
setAxisLabelZ
public void setAxisLabelZ(String label)
-
setShowAxisMarkerZ
public void setShowAxisMarkerZ(boolean show)
-
setShowMinorTicksZ
public void setShowMinorTicksZ(boolean show)
-
setMarkerWidthZ
public void setMarkerWidthZ(int width)
-
setTickSpacingZ
public void setTickSpacingZ(int spacing)
-
setMinorTickCountZ
public void setMinorTickCountZ(int count)
-
setAxisLabelX
public void setAxisLabelX(String label)
-
setShowAxisMarkerX
public void setShowAxisMarkerX(boolean show)
-
setShowMinorTicksX
public void setShowMinorTicksX(boolean show)
-
setMarkerWidthX
public void setMarkerWidthX(int width)
-
setTickSpacingX
public void setTickSpacingX(int spacing)
-
setMinorTickCountX
public void setMinorTickCountX(int count)
-
setAxisLabelY
public void setAxisLabelY(String label)
-
setShowAxisMarkerY
public void setShowAxisMarkerY(boolean show)
-
setShowMinorTicksY
public void setShowMinorTicksY(boolean show)
-
setMarkerWidthY
public void setMarkerWidthY(int width)
-
setTickSpacingY
public void setTickSpacingY(int spacing)
-
setMinorTickCountY
public void setMinorTickCountY(int count)
-
validate
public void validate()
-
setAbsoluteMaxX
public void setAbsoluteMaxX(double value)
-
setAbsoluteMinX
public void setAbsoluteMinX(double value)
-
setAbsoluteMaxY
public void setAbsoluteMaxY(double value)
-
setAbsoluteMinY
public void setAbsoluteMinY(double value)
-
setAbsoluteMaxZ
public void setAbsoluteMaxZ(double value)
-
setAbsoluteMinZ
public void setAbsoluteMinZ(double value)
-
setMaxX
public void setMaxX(double value)
-
setMinX
public void setMinX(double value)
-
setMaxY
public void setMaxY(double value)
-
setMinY
public void setMinY(double value)
-
setMaxZ
public void setMaxZ(double value)
-
setMinZ
public void setMinZ(double value)
-
lockMaxX
public void lockMaxX(double value)
-
lockMinX
public void lockMinX(double value)
-
lockMaxY
public void lockMaxY(double value)
-
lockMinY
public void lockMinY(double value)
-
lockMaxZ
public void lockMaxZ(double value)
-
lockMinZ
public void lockMinZ(double value)
-
unlockMaxX
public void unlockMaxX()
-
unlockMinX
public void unlockMinX()
-
unlockMaxY
public void unlockMaxY()
-
unlockMinY
public void unlockMinY()
-
unlockMaxZ
public void unlockMaxZ()
-
unlockMinZ
public void unlockMinZ()
-
setSelectionSize
public void setSelectionSize(double value)
-
lockAspectRatioXY
public void lockAspectRatioXY(double x_to_y_ratio)
-
getAxisPainterX
public NumericAxisPainter getAxisPainterX()
-
getAxisPainterY
public NumericAxisPainter getAxisPainterY()
-
getAxisPainterZ
public NumericAxisPainter getAxisPainterZ()
-
getLabelHandlerX
public GridAxisLabelHandler getLabelHandlerX()
-
getLabelHandlerY
public GridAxisLabelHandler getLabelHandlerY()
-
getLabelHandlerZ
public GridAxisLabelHandler getLabelHandlerZ()
-
getLayoutX
public GlimpseLayout getLayoutX()
-
getLayoutY
public GlimpseLayout getLayoutY()
-
getLayoutZ
public GlimpseLayout getLayoutZ()
-
getLayoutCenter
public GlimpseAxisLayout2D getLayoutCenter()
-
getLayoutTitle
public GlimpseLayout getLayoutTitle()
-
getTargetStackX
public GlimpseTargetStack getTargetStackX()
-
getTargetStackY
public GlimpseTargetStack getTargetStackY()
-
getTargetStackZ
public GlimpseTargetStack getTargetStackZ()
-
getTargetStackCenter
public GlimpseTargetStack getTargetStackCenter()
-
getTargetStackTitle
public GlimpseTargetStack getTargetStackTitle()
-
addGlimpseMouseListener
public void addGlimpseMouseListener(GlimpseMouseListener listener)
- Specified by:
addGlimpseMouseListener
in interfaceMouseable
- Overrides:
addGlimpseMouseListener
in classGlimpseLayout
-
addGlimpseMouseMotionListener
public void addGlimpseMouseMotionListener(GlimpseMouseMotionListener listener)
- Specified by:
addGlimpseMouseMotionListener
in interfaceMouseable
- Overrides:
addGlimpseMouseMotionListener
in classGlimpseLayout
-
addGlimpseMouseWheelListener
public void addGlimpseMouseWheelListener(GlimpseMouseWheelListener listener)
- Specified by:
addGlimpseMouseWheelListener
in interfaceMouseable
- Overrides:
addGlimpseMouseWheelListener
in classGlimpseLayout
-
addGlimpseMouseAllListener
public void addGlimpseMouseAllListener(GlimpseMouseAllListener listener)
- Specified by:
addGlimpseMouseAllListener
in interfaceMouseable
- Overrides:
addGlimpseMouseAllListener
in classGlimpseLayout
-
addGlimpseKeyListener
public void addGlimpseKeyListener(GlimpseKeyListener listener)
- Specified by:
addGlimpseKeyListener
in interfaceKeyable
- Overrides:
addGlimpseKeyListener
in classGlimpseLayout
-
removeGlimpseMouseAllListener
public void removeGlimpseMouseAllListener(GlimpseMouseAllListener listener)
- Specified by:
removeGlimpseMouseAllListener
in interfaceMouseable
- Overrides:
removeGlimpseMouseAllListener
in classGlimpseLayout
-
removeGlimpseMouseListener
public void removeGlimpseMouseListener(GlimpseMouseListener listener)
- Specified by:
removeGlimpseMouseListener
in interfaceMouseable
- Overrides:
removeGlimpseMouseListener
in classGlimpseLayout
-
removeGlimpseMouseMotionListener
public void removeGlimpseMouseMotionListener(GlimpseMouseMotionListener listener)
- Specified by:
removeGlimpseMouseMotionListener
in interfaceMouseable
- Overrides:
removeGlimpseMouseMotionListener
in classGlimpseLayout
-
removeGlimpseMouseWheelListener
public void removeGlimpseMouseWheelListener(GlimpseMouseWheelListener listener)
- Specified by:
removeGlimpseMouseWheelListener
in interfaceMouseable
- Overrides:
removeGlimpseMouseWheelListener
in classGlimpseLayout
-
removeGlimpseKeyListener
public void removeGlimpseKeyListener(GlimpseKeyListener listener)
- Specified by:
removeGlimpseKeyListener
in interfaceKeyable
- Overrides:
removeGlimpseKeyListener
in classGlimpseLayout
-
toString
public String toString()
- Overrides:
toString
in classGlimpseLayout
-
-