public abstract class View extends JPanel
Basically a view is a Swing panel where a GraphRenderer
renders the
graphic graph. If you are in the Swing thread, you can change the view on the
graphic graph using methods to translate, zoom and rotate the view.
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
private String |
id
The view identifier.
|
private static long |
serialVersionUID |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Modifier and Type | Method and Description |
---|---|
abstract ArrayList<GraphicElement> |
allNodesOrSpritesIn(double x1,
double y1,
double x2,
double y2)
Search for all the nodes and sprites contained inside the rectangle
(x1,y1)-(x2,y2).
|
abstract void |
beginSelectionAt(double x1,
double y1)
Called by the mouse manager to specify where a node and sprite selection
started.
|
abstract void |
close(GraphicGraph graph)
Close definitively this view.
|
abstract void |
display(GraphicGraph graph,
boolean graphChanged)
Redisplay or update the view contents.
|
abstract void |
endSelectionAt(double x2,
double y2)
Called by the mouse manager to specify where a node and spite selection
stopped.
|
abstract GraphicElement |
findNodeOrSpriteAt(double x,
double y)
Search for the first node or sprite (in that order) that contains the
point at coordinates (x, y).
|
abstract void |
freezeElement(GraphicElement element,
boolean frozen)
Freeze an element so that the optional layout cannot move it.
|
abstract Camera |
getCamera()
Get a camera object to provide control commands on the view.
|
String |
getId() |
abstract void |
moveElementAtPx(GraphicElement element,
double x,
double y)
Force an element to move at the given location in pixels.
|
abstract void |
openInAFrame(boolean on)
Open this view JPanel in a frame.
|
abstract void |
resizeFrame(int width,
int height)
Set the size of the view frame, if any.
|
abstract void |
selectionGrowsAt(double x,
double y)
The selection already started grows toward position (x, y).
|
abstract void |
setBackLayerRenderer(LayerRenderer renderer)
Set a layer renderer that will be called each time the graph needs to be
redrawn before the graph is rendered.
|
abstract void |
setForeLayoutRenderer(LayerRenderer renderer)
Set a layer renderer that will be called each time the graph needs to be
redrawn after the graph is rendered.
|
abstract void |
setMouseManager(MouseManager manager)
Change the manager for mouse events on this view.
|
abstract void |
setShortcutManager(ShortcutManager manager)
Change the manager for key and shortcuts events on this view.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
private static final long serialVersionUID
public abstract Camera getCamera()
public abstract GraphicElement findNodeOrSpriteAt(double x, double y)
x
- The point abscissa.y
- The point ordinate.public abstract ArrayList<GraphicElement> allNodesOrSpritesIn(double x1, double y1, double x2, double y2)
x1
- The rectangle lowest point abscissa.y1
- The rectangle lowest point ordinate.x2
- The rectangle highest point abscissa.y2
- The rectangle highest point ordinate.public abstract void display(GraphicGraph graph, boolean graphChanged)
graph
- The graphic graph to represent.graphChanged
- True if the graph changed since the last call to this method.public abstract void close(GraphicGraph graph)
graph
- The graphic graph.public abstract void openInAFrame(boolean on)
on
- Add the panel in its own frame or remove it if it already was
in its own frame.public abstract void resizeFrame(int width, int height)
width
- The new width.height
- The new height.public abstract void beginSelectionAt(double x1, double y1)
x1
- The selection start abscissa.y1
- The selection start ordinate.public abstract void selectionGrowsAt(double x, double y)
x
- The new end selection abscissa.y
- The new end selection ordinate.public abstract void endSelectionAt(double x2, double y2)
x2
- The selection stop abscissa.y2
- The selection stop ordinate.public abstract void freezeElement(GraphicElement element, boolean frozen)
element
- The element.frozen
- If true the element cannot be moved automatically.public abstract void moveElementAtPx(GraphicElement element, double x, double y)
element
- The element.x
- The requested position abscissa in pixels.y
- The requested position ordinate in pixels.public abstract void setBackLayerRenderer(LayerRenderer renderer)
renderer
- The renderer (or null to remove it).public abstract void setForeLayoutRenderer(LayerRenderer renderer)
renderer
- The renderer (or null to remove it).public abstract void setMouseManager(MouseManager manager)
MouseManager.init(GraphicGraph, View)
method must not yet have been called.manager
- The new manager, or null to set the default manager.MouseManager
public abstract void setShortcutManager(ShortcutManager manager)
ShortcutManager.init(GraphicGraph, View)
method must not yet have been called.manager
- The new manager, or null to set the default managerShortcutManager
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses