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.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior -
Field Summary
Fields Modifier and Type Field Description static StringPARAM_DRAW_GRIDstatic StringPARAM_MAX_EDGESstatic StringPARAM_MAX_NODESbooleanprintInProgressFields inherited from class org.graffiti.plugins.views.defaults.GraffitiView
isFinishingTransacation, threadedRedrawFields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields 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 voidclose()Closes the current view.StringgetCategory()List<Parameter>getDefaultParameters()On first start or on reset there will be no preferences available.JComponentgetOptionDialogComponent()Returns the component, that should be displayed for this option pane.StringgetOptionName()StringgetPreferencesAlternativeName()return a custom preference category, that this class will reside in.static booleangetUseAntialiasingSetting()StringgetViewName()Returns the viewName.voidinit(JComponent options)This method is called every time this option pane is displayed.voidpaint(Graphics g)voidpostAttributeChanged(AttributeEvent e)Called after an attribute has been changed.voidpostNodeAdded(GraphEvent e)Called after an edge has been added to the graph.voidpostNodeRemoved(GraphEvent e)Called after a node has been removed from the graph.intprint(Graphics graphics, PageFormat pageFormat, int pageIndex)voidrepaint()voidsave(JComponent options)Called when the options dialog's "ok" button is clicked.voidsetGraph(Graph g)This methods sets the graph and adds the background color attribute, since this View supports background coloringvoidsetStatusProvider(BackgroundTaskStatusProviderSupportingExternalCall optStatus)booleanstatusDrawInProgress()voidtransactionFinished(TransactionEvent event, BackgroundTaskStatusProviderSupportingExternalCall status)Called when a transaction has stopped.voidupdatePreferences(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, zoomChangedMethods 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, worksWithTabMethods 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, updateUIMethods 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, validateMethods 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, transferFocusUpCycleMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.graffiti.event.AttributeListener
preAttributeAdded, preAttributeChanged, preAttributeRemovedMethods inherited from interface java.awt.dnd.Autoscroll
autoscroll, getAutoscrollInsetsMethods inherited from interface org.graffiti.event.EdgeListener
preDirectedChanged, preEdgeReversedMethods inherited from interface org.graffiti.event.GraphListener
preEdgeAdded, preEdgeRemoved, preGraphCleared, preNodeAdded, preNodeRemovedMethods inherited from interface org.graffiti.event.NodeListener
postUndirectedEdgeAdded, postUndirectedEdgeRemoved, preUndirectedEdgeAdded, preUndirectedEdgeRemovedMethods inherited from interface org.graffiti.options.OptionPane
getNameMethods 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:PreferencesInterfaceOn 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:
getDefaultParametersin interfacePreferencesInterface
-
updatePreferences
Description copied from interface:PreferencesInterfaceThis 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:
updatePreferencesin interfacePreferencesInterface
-
getPreferencesAlternativeName
Description copied from interface:PreferencesInterfacereturn 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:
getPreferencesAlternativeNamein interfacePreferencesInterface- Returns:
-
setGraph
This methods sets the graph and adds the background color attribute, since this View supports background coloring- Specified by:
setGraphin interfaceView- Overrides:
setGraphin classGraffitiView- Parameters:
g- graph this view should display.
-
paint
- Overrides:
paintin classJComponent
-
repaint
public void repaint() -
postAttributeChanged
Description copied from class:GraffitiViewCalled after an attribute has been changed.- Specified by:
postAttributeChangedin interfaceAttributeListener- Overrides:
postAttributeChangedin classGraffitiView- Parameters:
e- the AttributeEvent detailing the changes.
-
postNodeAdded
Description copied from class:GraffitiViewCalled after an edge has been added to the graph.- Specified by:
postNodeAddedin interfaceGraphListener- Overrides:
postNodeAddedin classGraffitiView- Parameters:
e- the GraphEvent detailing the changes.
-
postNodeRemoved
Description copied from class:GraffitiViewCalled 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:
postNodeRemovedin interfaceGraphListener- Overrides:
postNodeRemovedin classGraffitiView- Parameters:
e- the GraphEvent detailing the changes.
-
transactionFinished
public void transactionFinished(TransactionEvent event, BackgroundTaskStatusProviderSupportingExternalCall status)Description copied from class:GraffitiViewCalled when a transaction has stopped.- Specified by:
transactionFinishedin interfaceTransactionListener- Overrides:
transactionFinishedin classGraffitiView- Parameters:
event- the EdgeEvent detailing the changes.
-
close
public void close()Description copied from class:GraffitiViewCloses the current view.- Specified by:
closein interfaceView- Overrides:
closein classGraffitiView
-
getUseAntialiasingSetting
public static boolean getUseAntialiasingSetting() -
getOptionDialogComponent
Description copied from interface:OptionPaneReturns the component, that should be displayed for this option pane.- Specified by:
getOptionDialogComponentin interfaceOptionPane- Returns:
- DOCUMENT ME!
-
init
Description copied from interface:OptionPaneThis method is called every time this option pane is displayed. TheAbstractOptionPaneclass uses this to create the option pane's GUI only when needed.- Specified by:
initin interfaceOptionPane
-
getViewName
Description copied from class:AbstractViewReturns the viewName.- Specified by:
getViewNamein interfaceView- Overrides:
getViewNamein classGraffitiView- Returns:
- String
-
save
Description copied from interface:OptionPaneCalled when the options dialog's "ok" button is clicked. This should save any properties being edited in this option pane.- Specified by:
savein interfaceOptionPane
-
getCategory
- Specified by:
getCategoryin interfaceOptionPane
-
getOptionName
- Specified by:
getOptionNamein interfaceOptionPane
-
print
- Specified by:
printin interfacePrintable- Throws:
PrinterException
-
setStatusProvider
- Specified by:
setStatusProviderin interfacePaintStatusSupport
-
statusDrawInProgress
public boolean statusDrawInProgress()- Specified by:
statusDrawInProgressin interfacePaintStatusSupport
-