|
JGraphpad Pro
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
com.jgraph.editor.factory.JGraphEditorRuler
Component that displays a ruler for a JGraph component.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
protected int |
activelength
Specified that start and length of the active region, ie the region to paint with the background border. |
protected int |
activeoffset
Specified that start and length of the active region, ie the region to paint with the background border. |
protected Point |
drag
Holds the current and first mouse point. |
protected org.jgraph.JGraph |
graph
Reference to the attached graph. |
protected Color |
inactiveBackground
Defines the inactive background border. |
protected static int |
INCH
Internal constant used to describe the screen resolution (DPI). |
protected double |
increment
Parameters to control the display. |
protected boolean |
isMetric
Specifies the unit system. |
protected Point |
mouse
Holds the current and first mouse point. |
static NumberFormat |
numberFormat
Holds the shared number formatter. |
protected int |
orientation
Specifies the orientation. |
static int |
ORIENTATION_HORIZONTAL
Defines the constants for horizontal and vertical orientation. |
static int |
ORIENTATION_VERTICAL
Defines the constants for horizontal and vertical orientation. |
protected int |
rulerSize
Specifies height or width of the ruler. |
protected double |
scale
Specifies the scale for the metrics. |
protected double |
units
Parameters to control the display. |
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
JGraphEditorRuler(org.jgraph.JGraph graph,
int orientation)
Constructs a new ruler for the specified graph and orientation. |
|
| Method Summary | |
void |
dragEnter(DropTargetDragEvent arg0)
|
void |
dragExit(DropTargetEvent arg0)
|
void |
dragOver(DropTargetDragEvent arg0)
|
void |
drop(DropTargetDropEvent arg0)
|
void |
dropActionChanged(DropTargetDragEvent arg0)
|
Dimension |
getPreferredSize()
Returns the preferred size by replacing the respective component of the graph's preferred size with rulerSize. |
int |
getRulerSize()
Returns the ruler's horizontal or vertical size. |
boolean |
isMetric()
Returns true if the ruler uses metric units. |
void |
mouseDragged(MouseEvent e)
|
void |
mouseMoved(MouseEvent e)
|
void |
paintComponent(Graphics g)
Paints the ruler. |
void |
propertyChange(PropertyChangeEvent event)
|
void |
repaint(int x,
int y)
Repaints the ruler between the specified 0 and x or y depending on the orientation. |
void |
setActiveLength(int length)
Sets the length of the active region in pixels. |
void |
setActiveOffset(int offset)
Sets the start of the active region in pixels. |
void |
setMetric(boolean isMetric)
Sets if the ruler uses metric units. |
void |
setRulerSize(int rulerSize)
Sets the ruler's horizontal or vertical size. |
protected void |
updateDragPosition(Point pt)
Repaints the mouse position. |
protected void |
updateIncrementAndUnits()
Updates the local variables used for painting based on the current scale and unit system. |
protected void |
updateMousePosition(Point pt)
Repaints the mouse position. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static int ORIENTATION_HORIZONTAL
public static int ORIENTATION_VERTICAL
protected static int INCH
public static final NumberFormat numberFormat
NumberFormat.getInstance()protected Color inactiveBackground
protected int orientation
protected int activeoffset
protected int activelength
protected double scale
JGraphEditorDiagramPane.DEFAULT_PAGESCALE.
protected boolean isMetric
JGraphEditorDiagramPane.DEFAULT_ISMETRIC.
protected int rulerSize
protected org.jgraph.JGraph graph
protected Point drag
protected Point mouse
protected double increment
protected double units
| Constructor Detail |
public JGraphEditorRuler(org.jgraph.JGraph graph,
int orientation)
graph - The graph to create the ruler for.orientation - The orientation to use for the ruler.| Method Detail |
public void setActiveOffset(int offset)
offset - The start of the active region.public void setActiveLength(int length)
length - The length of the active region.public boolean isMetric()
public void setMetric(boolean isMetric)
isMetric - Whether to use metric units.public int getRulerSize()
public void setRulerSize(int rulerSize)
rulerSize - The rulerSize to set.public Dimension getPreferredSize()
rulerSize.
public void dragEnter(DropTargetDragEvent arg0)
dragEnter in interface DropTargetListenerpublic void dragExit(DropTargetEvent arg0)
dragExit in interface DropTargetListenerpublic void dragOver(DropTargetDragEvent arg0)
dragOver in interface DropTargetListenerpublic void drop(DropTargetDropEvent arg0)
drop in interface DropTargetListenerpublic void dropActionChanged(DropTargetDragEvent arg0)
dropActionChanged in interface DropTargetListenerpublic void mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListenerpublic void mouseDragged(MouseEvent e)
mouseDragged in interface MouseMotionListenerprotected void updateDragPosition(Point pt)
protected void updateMousePosition(Point pt)
public void propertyChange(PropertyChangeEvent event)
propertyChange in interface PropertyChangeListenerprotected void updateIncrementAndUnits()
public void repaint(int x,
int y)
x - The endpoint for repainting a horizontal ruler.y - The endpoint for repainting a vertical ruler.public void paintComponent(Graphics g)
g - The graphics to paint the ruler to.
|
JGraphpad Pro
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||