|
|||||||||
| 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
y.view.Graph2DView
public class Graph2DView
This is a powerful component to view graphs in 2-dimensional space.
It displays a Graph2D object. The same Graph2D object can be
displayed at different zoom levels in different views.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static byte |
BG_LAYER
Background layer constant. |
static byte |
FG_LAYER
Foreground layer constant. |
static int |
LAYER_MODE
Drawing mode constant. |
static int |
MOVE_SELECTION_MODE
Drawing mode constant. |
static int |
NORMAL_MODE
Drawing mode constant. |
static int |
SELECTION_BOX_MODE
Drawing mode constant. |
static int |
UNBUFFERED_MODE
Drawing mode constant. |
| 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 y.view.View2DConstants |
|---|
GRID_CROSS, GRID_LINES, GRID_NONE, GRID_POINTS |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
Graph2DView()
Creates a new Graph2DView containing an empty graph. |
|
Graph2DView(Graph2D graph)
Creates a new Graph2DView for a given graph. |
|
Graph2DView(Graph2D graph,
ViewControl vc)
Creates a new Graph2DView for a given graph and viewcontrol. |
|
| Method Summary | |
|---|---|
void |
addBackgroundDrawable(Drawable d)
Adds a background drawable to this view. |
void |
addDrawable(Drawable d)
Adds a drawable to this view. |
void |
addViewChangeListener(ViewChangeListener l)
View can not change, so this method does nothing. |
void |
addViewMode(ViewMode vm)
Adds a view mode to this Graph2DView. |
boolean |
adjustScrollBarVisibility()
Updates scrollbar visibility and adjustment for this view . |
void |
animationPerformed(AnimationEvent e)
AnimationListener implementation. |
void |
fitContent()
Fits the contents inside this view. |
void |
fitRectangle(Rectangle r)
Fits the given rectangle inside this view. |
void |
fitWorldRect()
Sets the size and offset of the displayed document's world rectangle to the size and offset of this view. |
void |
focusView(double newZoom,
Point2D newCenter,
boolean animated)
|
Collection |
getBackgroundDrawables()
Returns a collection of background Drawables associated with this view. |
BackgroundRenderer |
getBackgroundRenderer()
Returns the current BackgroundRenderer of this view. |
JComponent |
getCanvasComponent()
Returns the component that displays the contents of this view. |
Dimension |
getCanvasSize()
Returns the size of the canvas part of this component. |
Point2D |
getCenter()
Returns the world coordinate that is displayed in the center of this view. |
Component |
getComponent()
Returns this. |
View |
getCurrentView()
Returns this View. |
Collection |
getDrawables()
Returns a collection of Drawables currently associated with this view |
boolean |
getFitContentOnResize()
Whether or not the fitContentOnResize feature
is enabled. |
Frame |
getFrame()
Returns the frame this components belongs to. |
Graph2D |
getGraph2D()
Returns the graph that this view displays. |
Graph2DRenderer |
getGraph2DRenderer()
Returns the renderer used to render the bound Graph2D. |
Color |
getGridColor()
Returns the currently set grid color |
boolean |
getGridMode()
Asks if grid is on or off on the view. |
double |
getGridResolution()
Get resolution of grid. |
int |
getGridType()
Get type of grid. |
int |
getHorizontalScrollBarPolicy()
Returns the scroll bar policy for the horizontal scroll bar. |
Image |
getImage()
Deprecated. Use paintVisibleContent(Graphics2D) with a
graphics context of an appropriate image type instead. |
double |
getPaintDetailThreshold()
Returns the scale threshold after that less detailed versions of the graph are displayed |
int |
getVerticalScrollBarPolicy()
Returns the scroll bar policy for the vertical scroll bar. |
ViewControl |
getViewControl()
Returns the view control of this view. |
Cursor |
getViewCursor()
Returns the cursor that is displayed when the mouse is over this view. |
Iterator |
getViewModes()
Returns an iterator over an unmodifiable Collection of the currently installed ViewModes. |
Point |
getViewPoint()
Returns the world coordinate this view displays at its the upper left corner. |
Point2D |
getViewPoint2D()
Returns the world coordinate this view displays at its the upper left corner. |
Dimension |
getViewSize()
Returns the size of the drawing canvas. |
Rectangle |
getVisibleRect()
Returns the visible part of the world rectangle. |
Rectangle |
getWorldRect()
Returns the world rectangle defined for this view. |
double |
getZoom()
Returns the current zoom level of this view. |
void |
gridCursorActive(boolean active)
Activates/Deactivates the grid cursor. |
boolean |
isAntialiasedPainting()
Getter for property antialiasedPainting. |
boolean |
isFocusTraversable()
|
boolean |
isGridVisible()
Asks if grid is visible in the view. |
boolean |
isValidateRoot()
Returns false. |
void |
openLabelEditor(YLabel label,
double x,
double y)
Same as openLabelEditor(YLabel,double,double,PropertyChangeListener). |
void |
openLabelEditor(YLabel label,
double x,
double y,
PropertyChangeListener listener)
S |