|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.display.axes.AbstractAxes org.opensourcephysics.display.axes.CartesianType1 org.opensourcephysics.display.axes.CartesianInteractive
public class CartesianInteractive
A cartesian axis class that provides interactive scale adjustment with a mouse.
Field Summary | |
---|---|
static int |
HORZ_AXIS
|
static int |
HORZ_AXIS_MAX
|
static int |
HORZ_AXIS_MIN
|
static int |
HORZ_MAX
|
static int |
HORZ_MIN
|
static int |
HORZ_VAR
|
static int |
INSIDE
|
static int |
VERT_AXIS
|
static int |
VERT_AXIS_MAX
|
static int |
VERT_AXIS_MIN
|
static int |
VERT_MAX
|
static int |
VERT_MIN
|
static int |
VERT_VAR
|
Fields inherited from class org.opensourcephysics.display.axes.CartesianType1 |
---|
xLine, yLine |
Fields inherited from class org.opensourcephysics.display.axes.AbstractAxes |
---|
defaultBottomGutter, defaultLeftGutter, defaultRightGutter, defaultTopGutter, drawingPanel, gridcolor, interiorColor, labelFont, labelFormat, superscriptFont, titleFont, titleLine, visible |
Constructor Summary | |
---|---|
CartesianInteractive(PlottingPanel panel)
Constructs a set of interactive axes for a plotting panel. |
Method Summary | |
---|---|
void |
draw(DrawingPanel panel,
java.awt.Graphics g)
Draws the axes. |
Interactive |
findInteractive(DrawingPanel panel,
int xpix,
int ypix)
|
protected int |
findRegion(java.awt.Point p)
Finds the plot region containing the specified point. |
protected javax.swing.JPopupMenu |
getHorzVariablesPopup()
Gets a popup menu with horizontal axis variables. |
int |
getMouseRegion()
Gets the current plot region containing the mouse. |
java.awt.Cursor |
getPreferredCursor()
|
protected javax.swing.JPopupMenu |
getVertVariablesPopup()
Gets a popup menu with vertical axis variables. |
double |
getX()
Gets the drawing location. |
double |
getXMax()
Gets the maximum x needed to draw this object. |
double |
getXMin()
Gets the minimum x needed to draw this object. |
double |
getY()
Gets the drawing location. |
double |
getYMax()
Gets the maximum y needed to draw this object. |
double |
getYMin()
Gets the minimum y needed to draw this object. |
protected boolean |
hasHorzVariablesPopup()
Reports whether this provides a popup menu for setting the horizontal axis variable. |
protected boolean |
hasVertVariablesPopup()
Reports whether this provides a popup menu for setting the vertical axis variable. |
void |
hideScaleSetter()
Hides the scale setter. |
boolean |
isEnabled()
|
boolean |
isMeasured()
Determines if information is available to set min/max values. |
boolean |
isSelected()
|
void |
resizeFonts(double factor,
DrawingPanel panel)
Resizes fonts by the specified factor. |
void |
setEnabled(boolean enable)
|
void |
setSelected(boolean selectable)
|
void |
setXY(double x,
double y)
|
void |
toggleSelected()
|
Methods inherited from class org.opensourcephysics.display.axes.CartesianType1 |
---|
addXTick, addYTick, drawPlot, getInterior, getTitle, getXLabel, getYLabel, isXLog, isYLog, setLabelFont, setShowMajorXGrid, setShowMajorYGrid, setShowMinorXGrid, setShowMinorYGrid, setTitle, setTitleFont, setX, setXLabel, setXLog, setY, setYLabel, setYLog |
Methods inherited from class org.opensourcephysics.display.axes.AbstractAxes |
---|
getInteriorBackground, isVisible, resetPanelGutters, setDefaultGutters, setInteriorBackground, setVisible |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.opensourcephysics.display.Interactive |
---|
setX, setY |
Methods inherited from interface org.opensourcephysics.display.axes.DrawableAxes |
---|
getInteriorBackground, setInteriorBackground, setVisible |
Field Detail |
---|
public static final int INSIDE
public static final int HORZ_MIN
public static final int HORZ_MAX
public static final int VERT_MIN
public static final int VERT_MAX
public static final int HORZ_AXIS
public static final int HORZ_AXIS_MIN
public static final int HORZ_AXIS_MAX
public static final int VERT_AXIS
public static final int VERT_AXIS_MIN
public static final int VERT_AXIS_MAX
public static final int HORZ_VAR
public static final int VERT_VAR
Constructor Detail |
---|
public CartesianInteractive(PlottingPanel panel)
panel
- the PlottingPanelMethod Detail |
---|
public int getMouseRegion()
public void draw(DrawingPanel panel, java.awt.Graphics g)
draw
in interface Drawable
draw
in class CartesianType1
panel
- the drawing panelg
- the graphics contextpublic double getX()
CartesianAxes
getX
in interface CartesianAxes
getX
in interface Interactive
getX
in class CartesianType1
public double getY()
CartesianAxes
getY
in interface CartesianAxes
getY
in interface Interactive
getY
in class CartesianType1
public void setSelected(boolean selectable)
setSelected
in interface Selectable
public boolean isSelected()
isSelected
in interface Selectable
public void toggleSelected()
toggleSelected
in interface Selectable
public java.awt.Cursor getPreferredCursor()
getPreferredCursor
in interface Selectable
public boolean isEnabled()
isEnabled
in interface Interactive
public void setEnabled(boolean enable)
setEnabled
in interface Interactive
public Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
findInteractive
in interface Interactive
public void setXY(double x, double y)
setXY
in interface Interactive
public boolean isMeasured()
Measurable
isMeasured
in interface Measurable
public double getXMin()
Measurable
getXMin
in interface Measurable
public double getXMax()
Measurable
getXMax
in interface Measurable
public double getYMin()
Measurable
getYMin
in interface Measurable
public double getYMax()
Measurable
getYMax
in interface Measurable
public void hideScaleSetter()
public void resizeFonts(double factor, DrawingPanel panel)
resizeFonts
in interface DrawableAxes
resizeFonts
in class CartesianType1
factor
- the factorpanel
- the drawing panel on which these axes are drawnprotected boolean hasHorzVariablesPopup()
protected javax.swing.JPopupMenu getHorzVariablesPopup()
protected boolean hasVertVariablesPopup()
protected javax.swing.JPopupMenu getVertVariablesPopup()
protected int findRegion(java.awt.Point p)
p
- the point
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |