Class IPKGraffitiView
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
org.graffiti.plugin.view.AbstractView
org.graffiti.plugins.views.defaults.GraffitiView
de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.ipk_graffitiview.IPKGraffitiView
- All Implemented Interfaces:
PaintStatusSupport
,Autoscroll
,ImageObserver
,MenuContainer
,Printable
,Serializable
,EventListener
,AttributeListener
,EdgeListener
,GraphListener
,NodeListener
,TransactionListener
,OptionPane
,PreferencesInterface
,GraphView
,View
,View2D
,Zoomable
,ZoomListener
- Direct Known Subclasses:
ButtonOverlayView
public class IPKGraffitiView extends GraffitiView implements OptionPane, Printable, PaintStatusSupport, PreferencesInterface
An implementation of
org.graffiti.plugin.view.View2D
, that
displays a graph. Since it also shows changes in the graph it listens for
changes in the graph, attributes, nodes and edges.- See Also:
JPanel
,View2D
, Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior
-
Field Summary
Fields Modifier and Type Field Description static String
PARAM_DRAW_GRID
static String
PARAM_MAX_EDGES
static String
PARAM_MAX_NODES
boolean
printInProgress
Fields inherited from class org.graffiti.plugins.views.defaults.GraffitiView
isFinishingTransacation, threadedRedraw
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
-
Constructor Summary
Constructors Constructor Description IPKGraffitiView()
-
Method Summary
Modifier and Type Method Description void
close()
Closes the current view.String
getCategory()
List<Parameter>
getDefaultParameters()
On first start or on reset there will be no preferences available.JComponent
getOptionDialogComponent()
Returns the component, that should be displayed for this option pane.String
getOptionName()
String
getPreferencesAlternativeName()
return a custom preference category, that this class will reside in.static boolean
getUseAntialiasingSetting()
String
getViewName()
Returns the viewName.void
init(JComponent options)
This method is called every time this option pane is displayed.void
paint(Graphics g)
void
postAttributeChanged(AttributeEvent e)
Called after an attribute has been changed.void
postNodeAdded(GraphEvent e)
Called after an edge has been added to the graph.void
postNodeRemoved(GraphEvent e)
Called after a node has been removed from the graph.int
print(Graphics graphics, PageFormat pageFormat, int pageIndex)
void
repaint()
void
save(JComponent options)
Called when the options dialog's "ok" button is clicked.void
setGraph(Graph g)
This methods sets the graph and adds the background color attribute, since this View supports background coloringvoid
setStatusProvider(BackgroundTaskStatusProviderSupportingExternalCall optStatus)
boolean
statusDrawInProgress()
void
transactionFinished(TransactionEvent event, BackgroundTaskStatusProviderSupportingExternalCall status)
Called when a transaction has stopped.void
updatePreferences(Preferences preferences)
This method will be called, when preferences for this class have changed and the implementing class gets the chance of setting class (static) variables having the values of the parameters.Methods inherited from class org.graffiti.plugins.views.defaults.GraffitiView
addMessageListener, addMouseListener, addMouseMotionListener, attributeChanged, completeRedraw, findComponentAt, getBlockEdges, getComponentAt, getComponentOfAnyTypeAt, getCoordinateSystem, getDetachedFrames, getDrawMode, getGraphics, getSortedGraphElements, isHidden, postAttributeAdded, postAttributeRemoved, postDirectedChanged, postEdgeAdded, postEdgeRemoved, postEdgeReversed, postGraphCleared, postSourceNodeChanged, postTargetNodeChanged, preSourceNodeChanged, preTargetNodeChanged, putInScrollPane, redrawActive, remove, removeMessageListener, removeMouseListener, removeMouseMotionListener, repaint, repaintGraphElementComponent, setBlockEdges, setDrawMode, sortGraphElements, transactionStarted, zoomChanged
Methods inherited from class org.graffiti.plugin.view.AbstractView
autoresize, autoscroll, clearGraphElementComponentMap, closing, getAttributeComponentsForElement, getAutoscrollInsets, getComponentElementMap, getComponentForElement, getGraph, getGraphElementComponent, getGraphElementComponentMap, getViewComponent, getViewToolbarComponentBackground, getViewToolbarComponentBottom, getViewToolbarComponentLeft, getViewToolbarComponentRight, getViewToolbarComponentTop, getZoom, postInEdgeAdded, postInEdgeRemoved, postOutEdgeAdded, postOutEdgeRemoved, postUndirectedEdgeAdded, postUndirectedEdgeRemoved, preAttributeAdded, preAttributeChanged, preAttributeRemoved, preDirectedChanged, preEdgeAdded, preEdgeRemoved, preEdgeReversed, preGraphCleared, preInEdgeAdded, preInEdgeRemoved, preNodeAdded, preNodeRemoved, preOutEdgeAdded, preOutEdgeRemoved, preUndirectedEdgeAdded, preUndirectedEdgeRemoved, removeGraphElementComponent, setAttributeComponentManager, worksWithTab
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, getComponent, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, 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, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.graffiti.event.AttributeListener
preAttributeAdded, preAttributeChanged, preAttributeRemoved
Methods inherited from interface java.awt.dnd.Autoscroll
autoscroll, getAutoscrollInsets
Methods inherited from interface org.graffiti.event.EdgeListener
preDirectedChanged, preEdgeReversed
Methods inherited from interface org.graffiti.event.GraphListener
preEdgeAdded, preEdgeRemoved, preGraphCleared, preNodeAdded, preNodeRemoved
Methods inherited from interface org.graffiti.event.NodeListener
postUndirectedEdgeAdded, postUndirectedEdgeRemoved, preUndirectedEdgeAdded, preUndirectedEdgeRemoved
Methods inherited from interface org.graffiti.options.OptionPane
getName
Methods inherited from interface org.graffiti.plugin.view.View
closing, getAttributeComponentsForElement, getComponentElementMap, getComponentForElement, getGraph, getViewComponent, getViewToolbarComponentBackground, getViewToolbarComponentBottom, getViewToolbarComponentLeft, getViewToolbarComponentRight, getViewToolbarComponentTop, setAttributeComponentManager, worksWithTab
-
Field Details
-
PARAM_MAX_NODES
-
PARAM_MAX_EDGES
-
PARAM_DRAW_GRID
-
printInProgress
public boolean printInProgress
-
-
Constructor Details
-
IPKGraffitiView
public IPKGraffitiView()
-
-
Method Details
-
getDefaultParameters
Description copied from interface:PreferencesInterface
On first start or on reset there will be no preferences available. The PreferenceManager will read this list containing the set of settings, that the implementing class thinks can be configured provide default values. All Parameters in this list will also appear in the PreferenceDialog. Entities providing preferences should add parameters to this array.- Specified by:
getDefaultParameters
in interfacePreferencesInterface
-
updatePreferences
Description copied from interface:PreferencesInterface
This method will be called, when preferences for this class have changed and the implementing class gets the chance of setting class (static) variables having the values of the parameters. Setting static class variables will help increase speed, when querying the parameters. Direct variable access VS querying the Preferences Object for this class- Specified by:
updatePreferences
in interfacePreferencesInterface
-
getPreferencesAlternativeName
Description copied from interface:PreferencesInterface
return a custom preference category, that this class will reside in. If null is returned, this class will be put into a standard category dependent on its Super class- Specified by:
getPreferencesAlternativeName
in interfacePreferencesInterface
- Returns:
-
setGraph
This methods sets the graph and adds the background color attribute, since this View supports background coloring- Specified by:
setGraph
in interfaceView
- Overrides:
setGraph
in classGraffitiView
- Parameters:
g
- graph this view should display.
-
paint
- Overrides:
paint
in classJComponent
-
repaint
public void repaint() -
postAttributeChanged
Description copied from class:GraffitiView
Called after an attribute has been changed.- Specified by:
postAttributeChanged
in interfaceAttributeListener
- Overrides:
postAttributeChanged
in classGraffitiView
- Parameters:
e
- the AttributeEvent detailing the changes.
-
postNodeAdded
Description copied from class:GraffitiView
Called after an edge has been added to the graph.- Specified by:
postNodeAdded
in interfaceGraphListener
- Overrides:
postNodeAdded
in classGraffitiView
- Parameters:
e
- the GraphEvent detailing the changes.
-
postNodeRemoved
Description copied from class:GraffitiView
Called after a node has been removed from the graph. All edges incident to this node have already been removed (preEdgeRemoved and postEdgeRemoved have been called).- Specified by:
postNodeRemoved
in interfaceGraphListener
- Overrides:
postNodeRemoved
in classGraffitiView
- Parameters:
e
- the GraphEvent detailing the changes.
-
transactionFinished
public void transactionFinished(TransactionEvent event, BackgroundTaskStatusProviderSupportingExternalCall status)Description copied from class:GraffitiView
Called when a transaction has stopped.- Specified by:
transactionFinished
in interfaceTransactionListener
- Overrides:
transactionFinished
in classGraffitiView
- Parameters:
event
- the EdgeEvent detailing the changes.
-
close
public void close()Description copied from class:GraffitiView
Closes the current view.- Specified by:
close
in interfaceView
- Overrides:
close
in classGraffitiView
-
getUseAntialiasingSetting
public static boolean getUseAntialiasingSetting() -
getOptionDialogComponent
Description copied from interface:OptionPane
Returns the component, that should be displayed for this option pane.- Specified by:
getOptionDialogComponent
in interfaceOptionPane
- Returns:
- DOCUMENT ME!
-
init
Description copied from interface:OptionPane
This method is called every time this option pane is displayed. TheAbstractOptionPane
class uses this to create the option pane's GUI only when needed.- Specified by:
init
in interfaceOptionPane
-
getViewName
Description copied from class:AbstractView
Returns the viewName.- Specified by:
getViewName
in interfaceView
- Overrides:
getViewName
in classGraffitiView
- Returns:
- String
-
save
Description copied from interface:OptionPane
Called when the options dialog's "ok" button is clicked. This should save any properties being edited in this option pane.- Specified by:
save
in interfaceOptionPane
-
getCategory
- Specified by:
getCategory
in interfaceOptionPane
-
getOptionName
- Specified by:
getOptionName
in interfaceOptionPane
-
print
- Specified by:
print
in interfacePrintable
- Throws:
PrinterException
-
setStatusProvider
- Specified by:
setStatusProvider
in interfacePaintStatusSupport
-
statusDrawInProgress
public boolean statusDrawInProgress()- Specified by:
statusDrawInProgress
in interfacePaintStatusSupport
-