Class WorldGrid
java.lang.Object
org.opensourcephysics.cabrillo.tracker.WorldGrid
This draws a world grid on a TrackerPanel.
- Author:
- Douglas Brown
-
Field Summary
Fields inherited from interface org.opensourcephysics.media.core.Trackable
PROPERTY_ADJUSTING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(DrawingPanel panel, Graphics g) Draws a representation of an object in a drawing panel.intgetAlpha()Gets the alpha.getColor()Gets the color.protected MarkgetMark(TrackerPanel trackerPanel) booleanisCustom()Determines if the color or alpha has been customized.booleanGets the visibility of the axes.voidsetAlpha(int alpha) Sets the alpha.voidSets the color.voidsetMajorXGridVisible(boolean visible) Sets the visibility of the major x grid lines.voidsetMajorYGridVisible(boolean visible) Sets the visibility of the major y grid lines.voidsetMinorXGridVisible(boolean visible) Sets the visibility of the minor x grid lines.voidsetMinorYGridVisible(boolean visible) Sets the visibility of the minor y grid lines.voidsetVisible(boolean isVisible) Sets the visibility of the axes.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensourcephysics.display.Drawable
isInteractive
-
Constructor Details
-
WorldGrid
public WorldGrid()
-
-
Method Details
-
draw
Description copied from interface:DrawableDraws a representation of an object in a drawing panel. -
getMark
-
getColor
Gets the color.- Returns:
- the line color
-
setColor
Sets the color.- Parameters:
color- the desired line color
-
getAlpha
public int getAlpha()Gets the alpha.- Returns:
- the line color alpha
-
setAlpha
public void setAlpha(int alpha) Sets the alpha.- Parameters:
alpha- the desired alpha
-
setVisible
public void setVisible(boolean isVisible) Sets the visibility of the axes.- Parameters:
isVisible- true if the axes are visible
-
isVisible
public boolean isVisible()Gets the visibility of the axes.- Returns:
- true if the axes is drawn
-
isCustom
public boolean isCustom()Determines if the color or alpha has been customized.- Returns:
- true if a custom color or alpha has been set
-
setMajorXGridVisible
public void setMajorXGridVisible(boolean visible) Sets the visibility of the major x grid lines.- Parameters:
visible- true to display the major x grid lines
-
setMinorXGridVisible
public void setMinorXGridVisible(boolean visible) Sets the visibility of the minor x grid lines.- Parameters:
visible- true to display the minor x grid lines
-
setMajorYGridVisible
public void setMajorYGridVisible(boolean visible) Sets the visibility of the major y grid lines.- Parameters:
visible- true to display the major y grid lines
-
setMinorYGridVisible
public void setMinorYGridVisible(boolean visible) Sets the visibility of the minor y grid lines.- Parameters:
visible- true to display the minor y grid lines
-