JavaView® v2.12

jv.thirdParty.ruler
Class PgAxes

java.lang.Object
  |
  +--jv.object.PsObject
        |
        +--jv.project.PgGeometry
              |
              +--jv.thirdParty.ruler.PgAxes
All Implemented Interfaces:
java.lang.Cloneable, PgGeometryIf, PsUpdateIf, java.io.Serializable

public final class PgAxes
extends PgGeometry

An Axes Geometry is a Composition of Rulers. This object constucts a variety of customizable 2D and 3D axes. A 1D axes is a ruler alone, so instantiate from that the ruler.PgRuler class.

Version:
31.03.01, 2.00 revised (kp) Major revision to increase update speed.
08.08.00, 1.00 created (spd)
Author:
Steve Dugaro
See Also:
PgRuler, Serialized Form

Field Summary
static int AXES_2DXY_CENTER
           
static int AXES_2DXY_CORNER
           
static int AXES_2DYZ_CENTER
           
static int AXES_2DYZ_CORNER
           
static int AXES_2DZX_CENTER
           
static int AXES_2DZX_CORNER
           
static int AXES_3DBOUNDINGBOX
           
static int AXES_3DCENTRAL
           
static int AXES_3DCORNER
           
 
Fields inherited from class jv.object.PsObject
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, NUM_TAGS
 
Fields inherited from interface jv.project.PgGeometryIf
AMBIENT_H2_HYPERBOLIC, AMBIENT_H3_HYPERBOLIC, AMBIENT_H4_HYPERBOLIC, AMBIENT_PROJECTIONS, AMBIENT_R1_EUCLIDEAN, AMBIENT_R2_EUCLIDEAN, AMBIENT_R3_EUCLIDEAN, AMBIENT_R4_EUCLIDEAN, AMBIENT_R5_EUCLIDEAN, AMBIENT_S1_SPHERE, AMBIENT_S2_SPHERE, AMBIENT_S3_SPHERE, AMBIENT_S4_SPHERE, AMBIENT_SPACES, INSPECTOR_CONTROL, INSPECTOR_CONTROL_EXT, INSPECTOR_MATERIAL, INSPECTOR_MATERIAL_EXT, INSPECTOR_TEXTURE, INSPECTOR_TEXTURE_EXT, LABEL_BASE, LABEL_CENTER, LABEL_HEAD, LABEL_MIDDLE, LABEL_TAIL, LABEL_TOP, METHOD_EXT, PROJ_KLEIN_BALL, PROJ_PARALLEL, PROJ_POINCARE_BALL, PROJ_STEREOGRAPHIC, PROJ_UPPER_HALFSPACE
 
Constructor Summary
PgAxes(int dim)
           
 
Method Summary
 void configure(PdVector[] bndBox, PdVector viewDir)
           
 PgGeometry[] getAxes()
          Set of axis will be returned.
 int getMode()
           
 void init()
          Initializes and resets geometry.
 boolean isShowingLabels()
           
 boolean isShowingMajorHashings()
           
 boolean isShowingMinorHashings()
           
 boolean isShowingTitles()
           
 boolean isShowingXYGrid()
           
 boolean isShowingYZGrid()
           
 boolean isShowingZXGrid()
           
 void setAutoConfigure(boolean flag)
          If set to true, axes in "absolute unit mode" will automatically adjust to a 'good' viewing scale based on the bounding box passed into configure().
 void setFixedHashings(double major, double minor)
           
 void setMode(int mode)
           
 void setPartitionedHashing(int major, int minor)
           
 void setTitleAlignments(int[] xAlign, int[] yAlign, int[] zAlign)
          each parameter is an array of 4 int values, [ruleralignment, labelalignment, deltax, deltay] where ruleralignment:={PgRuler.TITLE_ALIGN_LEFT,PgRuler.TITLE_ALIGN_RIGHT,PgRuler.TITLE_ALIGN_CENTER} labelalignment:=the side of the label to bound to given point, {PgGeometryIf.LABEL_HEAD, PgGeometryIf.LABEL_CENTER, PgGeometryIf.LABEL_TAIL} deltax resp. deltay are the number of pixels to displace the label in the x resp. y direction.
 void setTitles(java.lang.String[] axisTitle)
           
 void showFixedMode(boolean flag)
           
 void showLabels(boolean flag)
           
 void showMajorHashings(boolean flag)
           
 void showMinorHashings(boolean flag)
           
 void showTitles(boolean flag)
           
 void showXYGrid(boolean flag)
           
 void showYZGrid(boolean flag)
           
 void showZXGrid(boolean flag)
           
 boolean update(java.lang.Object event)
          Update method of geometry updates registered panels, update listeners, and invokes a repaint in the registered displays.
 
Methods inherited from class jv.project.PgGeometry
addDisplay, addElement, addPolygon, addVertex, blend, clearTagElement, clearTagPolygon, clearTagVertex, clone, copy, fillMethodMenu, getAmbientBounds, getAmbientInvMatrix, getAmbientMatrix, getAmbientProjection, getAmbientSpace, getAuthorInfo, getAuthors, getBounds, getCenter, getCenterOfElement, getControlPanel, getDiameter, getDimOfSimplex, getDimOfVertices, getDisplays, getElement, getGeometryInfo, getJvx, getLabelAttribute, getMaterialPanel, getModelMatrix, getPolygon, getTextureImage, getTextureImageName, getTitle, getVersion, getVersionType, getVertex, hasAmbientMatrix, hasDisplay, hasModelMatrix, hasTagElement, hasTagPolygon, hasTagVertex, intersectionWithLine, isConfigurable, isShowingBndBox, isShowingCenter, isShowingTitle, isVisible, merge, paint, reflect, removeDisplay, removeElement, removePolygon, removeVertex, setAmbientMatrix, setAmbientProjection, setAmbientSpace, setAuthorInfo, setAuthors, setCenter, setDimOfSimplex, setElement, setGeometryInfo, setJvx, setLabelAttribute, setLabelAttribute, setModelMatrix, setPolygon, setState, setTagElement, setTagPolygon, setTagVertex, setTextureImage, setTextureImageName, setTitle, setVersion, setVersionType, setVertex, setVisible, showBndBox, showCenter, showTitle, toString
 
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, updatePanels
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jv.project.PgGeometryIf
assureInspector, getInfoPanel, getName, setName
 
Methods inherited from interface jv.object.PsUpdateIf
getFather, setParent
 

Field Detail

AXES_3DCENTRAL

public static final int AXES_3DCENTRAL

AXES_3DCORNER

public static final int AXES_3DCORNER

AXES_3DBOUNDINGBOX

public static final int AXES_3DBOUNDINGBOX

AXES_2DXY_CENTER

public static final int AXES_2DXY_CENTER

AXES_2DYZ_CENTER

public static final int AXES_2DYZ_CENTER

AXES_2DZX_CENTER

public static final int AXES_2DZX_CENTER

AXES_2DXY_CORNER

public static final int AXES_2DXY_CORNER

AXES_2DYZ_CORNER

public static final int AXES_2DYZ_CORNER

AXES_2DZX_CORNER

public static final int AXES_2DZX_CORNER
Constructor Detail

PgAxes

public PgAxes(int dim)
Method Detail

init

public void init()
Description copied from class: PgGeometry
Initializes and resets geometry.
Overrides:
init in class PgGeometry

update

public boolean update(java.lang.Object event)
Description copied from class: PgGeometry
Update method of geometry updates registered panels, update listeners, and invokes a repaint in the registered displays. Usage:
1. event == this : geometry has changed, all panels will be updated.
2. event == null : geometry has changed, no need to update a panel.
3. event == a panel : geometry has changed, all panels except 'panel' will be updated.
3. event == else : unhandled event, error.
Panels are not updated if they have not been created yet, or if they are not visible.

Any update is forwarded to the parent of the geometry with the geometry as event.

Any update is forwarded to each registered display with the geometry as event which leads to a repaint of the display.
Overrides:
update in class PgGeometry
Following copied from interface: jv.object.PsUpdateIf
Parameters:
event - carries a lot of information
Returns:
true if event has been handled, otherwise false
See Also:
PsObject, PsUpdateIf.getFather(), PsUpdateIf.setParent(PsUpdateIf)

isShowingXYGrid

public boolean isShowingXYGrid()

isShowingYZGrid

public boolean isShowingYZGrid()

isShowingZXGrid

public boolean isShowingZXGrid()

isShowingMajorHashings

public boolean isShowingMajorHashings()

isShowingMinorHashings

public boolean isShowingMinorHashings()

isShowingLabels

public boolean isShowingLabels()

isShowingTitles

public boolean isShowingTitles()

showXYGrid

public void showXYGrid(boolean flag)

showYZGrid

public void showYZGrid(boolean flag)

showZXGrid

public void showZXGrid(boolean flag)

showFixedMode

public void showFixedMode(boolean flag)

showMajorHashings

public void showMajorHashings(boolean flag)

showMinorHashings

public void showMinorHashings(boolean flag)

showLabels

public void showLabels(boolean flag)

showTitles

public void showTitles(boolean flag)

setTitles

public void setTitles(java.lang.String[] axisTitle)

setTitleAlignments

public void setTitleAlignments(int[] xAlign,
                               int[] yAlign,
                               int[] zAlign)
each parameter is an array of 4 int values, [ruleralignment, labelalignment, deltax, deltay] where ruleralignment:={PgRuler.TITLE_ALIGN_LEFT,PgRuler.TITLE_ALIGN_RIGHT,PgRuler.TITLE_ALIGN_CENTER} labelalignment:=the side of the label to bound to given point, {PgGeometryIf.LABEL_HEAD, PgGeometryIf.LABEL_CENTER, PgGeometryIf.LABEL_TAIL} deltax resp. deltay are the number of pixels to displace the label in the x resp. y direction.

setFixedHashings

public void setFixedHashings(double major,
                             double minor)

setPartitionedHashing

public void setPartitionedHashing(int major,
                                  int minor)

setAutoConfigure

public void setAutoConfigure(boolean flag)
If set to true, axes in "absolute unit mode" will automatically adjust to a 'good' viewing scale based on the bounding box passed into configure(). Essentially the scale jumps up or down by a factor of 10 if any length of the bounding box is streched to 10*currentscale + 10*currentscale/2 or squashed to currentscale/10-currentscale/10*2. In other words, an attempt is made to maintain approximately 10 hashings over each ruler. This need not apply to the "partitioned ruler mode" as the ruler is already subdivided. This is true by default-set to false if many more hashings are needed. Note that in this mode a sigle minor hashing will be placed between each major hashings whenever a reconfiguration is needed.

setMode

public void setMode(int mode)

getMode

public int getMode()

getAxes

public PgGeometry[] getAxes()
Set of axis will be returned. The ones you add to the display are up to you, but computations will be done for all assuming all will be displayed.

configure

public void configure(PdVector[] bndBox,
                      PdVector viewDir)

JavaView® v2.12

The software JavaView® is copyright protected. All Rights Reserved.