ilog.cpl.graph
Class IlpGraphView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by ilog.cpl.graph.IlpGraphView
All Implemented Interfaces:
IlpStylable, IlpBackgroundProvider, ilog.cpl.graphic.css.internal.IlpCSSGraphicView, IlpGraphicView, IlpStylableViewsView, IlpViewsView, IlvStylable, ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
IlpEquipmentView, IlpNetworkView

public abstract class IlpGraphView
extends JComponent
implements IlpStylableViewsView, ilog.cpl.graphic.css.internal.IlpCSSGraphicView, IlpBackgroundProvider

This class displays the contents of an IlpGraphModel in an ILOG JViews grapher.

Note:Links cannot be displayed unless both of their end nodes are visible in the same IlpGraphModel.

Since:
JTGO 4.0
See Also:
IlpGraphModel, IlpGraphController, Serialized Form

Nested Class Summary
 class IlpGraphView.VisibleModelConnector
          Connector between the graph view and the visible model.
 
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
protected  IlpGraphicViewStyleManager configuration
          Deprecated.  
static int SCROLLBAR_UNIT_INCREMENT
          Increment used by scrollbars Default value: 5
 
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 ilog.cpl.css.IlpStylable
UPDATE_ALL_MASK, UPDATE_COMPONENT_MASK, UPDATE_NONE_MASK, UPDATE_OBJECTS_MASK
 
Fields inherited from interface ilog.views.util.styling.IlvStylable
APPLIED_RULE_MASK, BAD_CLASS_MASK, BAD_PROP_MASK, BAD_PROP_WITH_STACK_MASK, CREATED_MASK, DECL_MASK, DECL_VALUE_MASK, FAILED_CONVERSIONS_MASK, TIME_REPORT_MASK, WARNING_PROP_MASK
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
protected IlpGraphView(IlpContext context)
          Creates a view.
 
Method Summary
protected  void activateDefaultViewInteractorName()
          Activates the defaultViewInteractorName on the current toolbar.
 void addBackground(URL backgroundURL)
          Adds a background on top of the other existing backgrounds.
 void addBackgroundURL(URL backgroundURL)
          Deprecated. Use instead addBackground(URL)
 void addDebugListener(Frame frame)
          Print all kinds of AWT events.
 void addGraphRendererListener(GraphRendererListener listener)
          Adds a listener to graph renderer change events.
 void addNodeExpansionListener(NodeExpansionListener listener)
          Adds the specified listener to receive events from the view when a subnetwork is collapsed or expanded.
 void addPendingContainerCollapse(IlpRepresentationObject object)
           
 void addPseudoClass(IlpObject bo, String pseudo)
          Adds a pseudoclass to the specified business object.
 void addPseudoClass(IlpRepresentationObject ro, String pseudo)
          Adds a pseudoclass to the specified representation object.
 void addSelectionObject(IlpObject object)
          Adds the given IlpObject to the selection.
 void addSelectionRepresentationObject(IlpRepresentationObject object)
          Adds the given IlpRepresentationObject to the selection.
 void addVisibleChildren(IlpRepresentationObject object)
          Adds the given object to the visible model.
 void clearSelection()
          Clears the selection.
 void collapseObject(IlpRepresentationObject object)
          Puts an object into the collapsed state, if possible.
protected  IlvGrapher createGrapher(IlpContext context)
          Creates the IlvGrapher used by this view.
protected abstract  IlpGraphSelectionModel createGraphSelectionModel()
          This method creates the default selection model.
protected  IlpManagerView createManagerView(IlvManager grapher, IlpContext context)
          Creates the IlvManagerView used by this view.
 Object createToolBarButtonFromAction(Action a)
          Creates a toolbar button to execute the given action.
protected abstract  ilog.cpl.graph.css.internal.IlpGraphViewCSSContext createViewCSSContext()
          Creates the CSS context that will provide support for Cascading Style Sheets in this graph view.
protected abstract  ilog.cpl.graph.internal.IlpGraphVisibleModel createVisibleModel()
          Create a new visible model.
 void defaultCollapseObject(IlpRepresentationObject object)
           
 void defaultExpandObject(IlpRepresentationObject object)
           
 boolean defaultIsExpanded(IlpRepresentationObject object)
           
 void dispose()
          Cleans up the view, and drops references to objects to help garbage collection.
 void doUpdateGraphic(IlpRepresentationObject object, IlpGraphic g)
          After all checks have been done, update an object.
 void enableLinkLayoutRendererConfiguration()
           
 void endDelayingUpdates()
          Undoes a call to startDelayingUpdates().
 boolean ensureAtCenter(IlpObject object)
          Scrolls the view in such a way that a given object gets moved to the center of the view.
 boolean ensureAtCenter(IlpRepresentationObject object)
          Scrolls the view in such a way that a given representation object gets moved to the center of the view.
 void ensureVisible()
          Scrolls the view in such a way that the contents becomes visible, as far as possible.
 boolean ensureVisible(Collection objects)
          Scrolls the view in such a way that a given list of representation objects becomes visible.
 boolean ensureVisible(IlpObject object)
          Scrolls the view in such a way that a given object becomes visible.
 boolean ensureVisible(IlpRepresentationObject object)
          Scrolls the view in such a way that a given representation object becomes visible.
 void expandObject(IlpRepresentationObject object)
          Puts an object into the expanded state.
 void fitToContents()
          Modifies the zoom factor so that all objects are visible in the view.
 void fitToContents(Insets insets)
          Modifies the zoom factor so that all objects are visible in the view.
 IlpAttribute getAttribute(IlpPoint viewLocation)
          Returns the IlpAttribute object at the given position in this object.
 int getAutoLayoutIndex()
          Returns the index of the graph layout that should be executed automatically when the view contents change.
 int getAutoLayoutIndex(IlpRepresentationObject ro)
          Returns the index of the graph layout that should be executed automatically in the subnetwork when the view contents change.
 IlvManagerLayer getBackgroundLayer(URL backgroundURL)
          Deprecated. Use instead List getBackgroundLayers(URL)
 List getBackgroundLayers(URL backgroundURL)
          Returns a List with the IlvManagerLayer instances that compose the provided URL.
 List getBackgrounds()
          Returns the list of URL instances that represent the current backgrounds.
 ilog.cpl.graph.css.renderer.IlpBackgroundsRenderer getBackgroundsRenderer()
           
 IlpBackgroundSupport getBackgroundSupport()
          Returns the background support object currently in use.
 Collection getBackgroundURLs()
          Deprecated. Use instead List getBackgrounds()
 IlvRect getBaseRectangle(IlpRepresentationObject object)
          Returns the base rectangle of the given representation object in manager view coordinates.
 IlvRect getBoundingBox(IlpRepresentationObject object)
          Returns the bounding box of the given representation object in manager view coordinates.
 IlvRect getBoundingBoxInManager(IlpRepresentationObject repObject)
          This method returns the bounding box of a given representation object in manager coordinates.
 IltCompositeGrapher getCompositeGrapher()
          Returns the IltCompositeGrapher used by this view.
 Container getContainer()
          Returns the concrete container where the graphics are currently being displayed.
 ilog.cpl.graph.internal.IlpContainerGraphic getContainerGraphic(IlpRepresentationObject object)
          Returns the IlpContainerGraphic object that was created by rendering a given container (ie non-leaf) representation object.
 IlpContext getContext()
          Returns the application context.
 IlpGraphicController getController()
          Returns the controller, that is responsible for the interaction between the user and the view.
 Action getDefaultGestureAction(IlpGesture gesture)
          Returns a default gesture action for a gesture or null as appropriate.
 IlpGraphicRenderer getDefaultGraphicRenderer()
          Deprecated. Please use CSS class property instead.
protected abstract  Class getDefaultLinkClass()
          Retrieves the default class that implements IlpRepresentationLink.
protected abstract  Class getDefaultNodeClass()
          Retrieves the default class that implements IlpRepresentationNode.
 String getDefaultViewInteractorName()
          Returns the default view interactor name.
 IlvGrapher getGrapher()
          Returns the IlvGrapher used by this view.
 IltCompositeGrapher getGrapherForCreateGraphic(IlpRepresentationObject object, IlpAttribute attribute)
          Returns the IltCompositeGrapher in which the graphic object, of type IltCompositeGraphic, of a given object should be created.
 IlpGraphic getGraphic(IlpPoint viewLocation)
          Returns the IlpGraphic object at the given position in this object.
 IlpGraphic getGraphic(IlpRepresentationObject object)
          Returns the IlpGraphic object that was created by rendering a given representation object.
abstract  Class getGraphicComponentClass()
          Returns the graphic component class supported by this implementation of graphic view.
 IlpGraphicHolder getGraphicHolder()
          Returns the association between representation objects and graphic objects.
 ilog.cpl.graphic.internal.IlpGraphicRendererContextFactory getGraphicRendererContextFactory()
          Accesses the renderer context factory (instance of IlpGraphicRendererContextFactory).
 ilog.cpl.graph.css.renderer.IlpGraphLayoutRenderer getGraphLayoutRenderer()
           
 IlvGraphLayout[] getGraphLayouts()
          Returns the list of graph layouts that have been configured to this view.
 IlvGraphLayout[] getGraphLayouts(IlpRepresentationObject ro)
          Returns the list of graph layouts that have been configured to the given subnetwork object.
 IlvGraphLayout getGraphLayouts(IlpRepresentationObject ro, int index)
          Returns the graph layout that is configured at the given index for the given subnetwork object.
 IlvGraphLayout getGraphLayouts(int index)
          Returns the graph layout that is configured at the given index.
 IlpGraphLayoutSupport getGraphLayoutSupport()
          Retrieves the layout support object.
 IlpGraphSelectionModel getGraphSelectionModel()
          Returns the selection model.
 JScrollBar getHorizontalScrollBar()
          Returns the horizontal scrollbar of the view.
 IlpGraphic getInnermostGraphic(IlpPoint viewLocation)
          Returns the innermost graphic at the given position in this object.
 Collection getInteractibleViews()
          Returns a list of all views that may matter for the interactors.
 ilog.cpl.graph.css.renderer.IlpInteractorRenderer getInteractorRenderer()
           
 IlvLabelLayout getLabelLayout()
          Returns the label layout used in this view, or null if there is no label layout.
 ilog.cpl.graph.css.renderer.IlpLabelLayoutRenderer getLabelLayoutRenderer()
           
 IlvGraphic getLayoutProxy(IlpGraphic graphic)
          Returns the IlvGraphic that represents this graphic object for layout purposes, or null if it is currently not in an ILOG JViews manager, or not considered by the layout.
 IlvGraphic getLayoutProxy(IlpRepresentationObject ro)
          Returns the IlvGraphic that represents this graphic object for layout purposes, or null if it is currently not in an ILOG JViews manager, or not considered by the layout.
 IlvGraphLayout getLinkLayout()
          Returns the graph layout for links.
 IlvGraphLayout getLinkLayout(IlpRepresentationObject ro)
          Returns the graph layout for links in the subnetwork of the given representation object.
 ilog.cpl.graph.css.renderer.IlpLinkLayoutRenderer getLinkLayoutRenderer()
           
 IlpManagerView getManagerView()
          Returns the main IlvManagerView displayed by this view.
 IlpGraphModel getModel()
          Returns the component's model.
 IlpMutableStyleSheet getMutableStyleSheet()
          Returns a mutable style sheet that can be used to change the view configuration dynamically.
 IlvGraphLayout getNodeLayout()
          Returns the graph layout of the view for nodes.
 IlpNodeRenderer getNodeRenderer()
          Returns the graphic object meta renderer.
 IlvJOverview getOverview()
          Returns the overview window, if currently visible.
 ilog.cpl.graph.css.renderer.IlpOverviewRenderer getOverviewRenderer()
           
 IlpPosition getPosition(IlpRepresentationObject object)
          Returns the current position or shape of an object.
 IlpPositionConverter getPositionConverter()
          Returns the position converter.
 ilog.cpl.graph.css.renderer.IlpPositioningRenderer getPositioningRenderer()
           
 IlpPositionSource getPositionSource(IlpRepresentationObject object)
          Returns the source of current position or shape of an object.
 List getPseudoClasses(IlpRepresentationObject ro, IlpAttribute a)
          Returns the custom pseudoclasses currently active for the object.
 IlpRepresentationObject getRepresentationObject(IlpGraphic g)
          Returns the IlpRepresentationObject that is rendered by the given IlpGraphic object.
 IlpRepresentationObject getRepresentationObject(IlpPoint viewLocation)
          Returns the IlpRepresentationObject at the given position in this object.
 IlpRepresentationObjectSelectionModel getRepresentationObjectSelectionModel()
          Returns the IlpRepresentationObjectSelectionModel used to handle the selection of representation objects.
 IlvJScrollManagerView getScrollView()
          Returns the panel containing the manager view and the scrollbars.
 IlpObject getSelectedObject()
          Returns the first selected IlpObject from the collection of selected objects.
 Collection getSelectedObjects()
          Returns the set of selected IlpObjects.
 IlpRepresentationObject getSelectedRepresentationObject()
          Returns a IlpRepresentationObject from the collection of selected representation objects.
 Collection getSelectedRepresentationObjects()
          Returns the set of selected IlpRepresentationObjects.
 IlpStyle getStyle()
          Deprecated.  
 IlpStyle getStyle(Class clazz)
          Deprecated.  
 IlpStyle getStyle(IlpClass clazz)
          Deprecated.  
 IlpStyle getStyle(IlpObject object)
          Deprecated.  
 IlpStyle getStyle(IlpRepresentationObject object)
          Deprecated.  
protected  IlpStyleListenerSupport getStyleListener(IltCompositeGraphic graphic)
          Returns a style listener for the given graphic.
 IlpGraphicViewStyleManager getStyleManager()
          Deprecated.  
 int getStyleSheetDebugMask()
          Returns the current debug level.
 String[] getStyleSheets()
          Returns the cascading style sheets.
 String getStyleSheets(int index)
          Returns one of the cascading style sheets.
 IlvGrapher getSubNetwork(IlpRepresentationObject object)
          Returns the IlvGrapher that corresponds to a subnetwork.
 IltCompositeGrapher getSubNetworkCompositeGrapher(IlpRepresentationObject object)
          Returns the IltCompositeGrapher that corresponds to a subnetwork.
protected  IlSynchronizationContext getSynchronizationContext()
          Returns the context information used to support multiple threads.
 JToolBar getToolBar()
          Returns the view toolbar.
 String getToolBarButtonClassFromActionType(String actionType)
          Returns the button class name that corresponds to the given action type This is used when configuring buttons for the component toolbar
 ilog.cpl.graph.css.renderer.IlpToolBarRenderer getToolBarRenderer()
           
 JScrollBar getVerticalScrollBar()
          Returns the vertical scrollbar of the view.
 ilog.cpl.graphic.css.internal.IlpViewCSSContext getViewCSSContext()
          Returns the context information needed to provide support to cascading style sheets.
protected abstract  Logger getViewLogger()
          Accesses the proper logger for handling log messages.
 ilog.cpl.graph.css.renderer.IlpViewRenderer getViewRenderer()
           
 IlpGraphView.VisibleModelConnector getVisibleModelConnector()
           
 Collection getVisibleObjects()
          Returns an unmodifiable collection of the visible objects contained in the view.
 ilog.cpl.graph.css.renderer.IlpZoomingRenderer getZoomingRenderer()
           
 IlpZoomPolicy getZoomPolicy()
          Returns the zoom policy currently in use.
 boolean hasStyleSheets()
          Returns true if style sheets have been defined for this view.
protected abstract  void initRenderers()
          Renderer initialization.
 void invalidate(IlpRepresentationObject ro)
          Invalidates the graphic representation of the given object.
 void invalidateGraphics()
          Invalidates all the graphic representations in this view.
 boolean isExpanded(IlpRepresentationObject object)
          Determines whether the object is currently expanded or collapsed.
 boolean isHorizontalScrollBarVisible()
          Returns true if the horizontal scrollbar is visible.
 boolean isLink(IlpRepresentationObject ro)
          Returns if the given object is a link in the visible model.
 boolean isModelChanging()
          Returns true if the model is changing.
 boolean isObjectSelected(IlpObject object)
          Returns true if the given IlpObject is selected, false otherwise.
 boolean isOverviewVisible()
          Returns true if the overview is currently visible.
 boolean isRepresentationObjectSelected(IlpRepresentationObject object)
          Returns true if the given IlpRepresentationObject is selected, false otherwise.
 boolean isToolBarExternal()
          Tests whether the toolbar is external to the graph view.
 boolean isToolBarVisible()
          Tests whether the toolbar is visible.
 boolean isVerticalScrollBarVisible()
          Returns true if the vertical scrollbar is visible.
 boolean isVisible(IlvManagerLayer layer)
          Returns the global visibility of a layer.
 boolean isVisible(IlvManagerLayer layer, IlvManagerView view)
          Returns the visibility of a layer in a view.
 boolean isVisible(URL backgroundURL)
          Returns the visibility of a particular background.
 void optimizeLayout()
          Applies the registered node and/or a link layout algorithm to the manager content.
 void performAttachedLayout(int index)
          Applies a given graph layout algorithm once to the manager content.
 void performLabelLayout()
          Perform the label layout in this view.
 void performLayoutOnce(IlvGraphLayout layout)
          Applies a given graph layout algorithm once to the manager content.
 void performLayoutOnce(IlvGraphLayout layout, Runnable initializations)
          Applies a given graph layout algorithm once to the manager content.
 void performLayoutOnce(IlvGraphLayout layout, Runnable initializations, Runnable postprocessing)
          Applies a given graph layout algorithm once to the manager content.
 void reload(URL backgroundURL)
          Deprecated. Use instead reloadBackground(URL)
 void reloadAllBackgrounds()
          Deprecated. Use instead reloadBackgrounds()
 void reloadBackground(URL backgroundURL)
          Reloads a particular background.
 void reloadBackgrounds()
          Reloads all backgrounds.
 void removeAllBackgroundURLs()
          Deprecated. Use instead removeBackgrounds()
 void removeBackground(URL backgroundURL)
          Removes a background.
 void removeBackgrounds()
          Removes all backgrounds.
 void removeBackgroundURL(URL backgroundURL)
          Deprecated. Use instead removeBackground(URL)
 void removeGraphRendererListener(GraphRendererListener listener)
          Removes a listener of graph renderer change events.
 void removeNodeExpansionListener(NodeExpansionListener listener)
          Removes the specified listener so that it no longer receives events from the view when a subnetwork is collapsed or expanded.
 void removePseudoClass(IlpObject bo, String pseudo)
          Removes a pseudoclass from the specified business object.
 void removePseudoClass(IlpRepresentationObject ro, String pseudo)
          Removes a pseudoclass from the specified representation object.
 void removeSelectionObject(IlpObject object)
          Removes the given IlpObject from the selection.
 void removeSelectionRepresentationObject(IlpRepresentationObject object)
          Removes the given IlpRepresentationObject from the selection.
 void selectAll()
          Puts all visible objects into the selection.
 void setAutoLayoutIndex(IlpRepresentationObject ro, int index)
          Sets the index of the graph layout that should be executed automatically in the subnetwork objects when the view contents change.
 void setAutoLayoutIndex(int index)
          Sets the index of the graph layout that should be executed automatically when the view contents change.
 void setBackgrounds(List backgroundURLs)
          Replaces the entire list of backgrounds.
protected  void setBackgroundsRenderer(ilog.cpl.graph.css.renderer.IlpBackgroundsRenderer backgroundsRenderer)
           
 void setBackgroundSupport(IlpBackgroundSupport backgroundSupport)
          Replaces the background support object.
 void setBackgroundURLs(URL[] backgroundURLs)
          Deprecated. Use instead setBackgrounds(List)
 void setController(IlpGraphicController controller)
          Sets the controller, that is responsible for the interaction between the user and the view.
 void setDefaultGraphicRenderer(IlpGraphicRenderer renderer)
          Deprecated. Please use CSS class property instead.
 void setDefaultViewInteractorName(String name)
          Sets the default view interactor and view interactor by name.
 void setGraphicRendererContextFactory(ilog.cpl.graphic.internal.IlpGraphicRendererContextFactory factory)
          Sets a new renderer context factory to be used to create new renderer contexts (instances of IlpGraphicRendererContext).
protected  void setGraphLayoutRenderer(ilog.cpl.graph.css.renderer.IlpGraphLayoutRenderer graphLayoutRenderer)
           
 void setGraphLayouts(IlpRepresentationObject ro, IlvGraphLayout[] layouts)
          Changes the layouts that can be applied to the subnetwork that represents the given representation object.
 void setGraphLayouts(IlpRepresentationObject ro, int index, IlvGraphLayout layout)
          Sets a new graph layout to this view.
 void setGraphLayouts(IlvGraphLayout[] layouts)
          Changes the layouts that can be applied to this view.
 void setGraphLayouts(int index, IlvGraphLayout layout)
          Sets a new graph layout to this view.
 void setGraphLayoutSupport(IlpGraphLayoutSupport layoutSupport)
          Replaces the layout support object.
 void setGraphSelectionModel(IlpGraphSelectionModel selModel)
          Sets the selection model.
 void setHorizontalScrollBarVisible(boolean set)
          Shows or hides the horizontal scrollbar.
protected  void setInteractorRenderer(ilog.cpl.graph.css.renderer.IlpInteractorRenderer interactorRenderer)
           
 void setLabelLayout(IlvLabelLayout layout)
          Sets the label layout in this view.
protected  void setLabelLayoutRenderer(ilog.cpl.graph.css.renderer.IlpLabelLayoutRenderer labelLayoutRenderer)
           
 void setLinkLayout(IlpRepresentationObject ro, IlvGraphLayout layout)
          Changes the link layout of subnetwork for the given representation object.
 void setLinkLayout(IlvGraphLayout layout)
          Changes the link layout of this view.
 void setLinkLayout(IlvGraphLayout layout, boolean relayout)
          Changes the link layout of this view.
protected  void setLinkLayoutRenderer(ilog.cpl.graph.css.renderer.IlpLinkLayoutRenderer linkLayoutRenderer)
           
 void setModel(IlpGraphModel model)
          Sets the component's model.
 void setNodeLayout(IlvGraphLayout layout)
          Changes the node layout of this view.
 void setNodeLayout(IlvGraphLayout layout, boolean relayout)
          Changes the node layout of this view.
 void setNodeRenderer(IlpNodeRenderer renderer)
          Changes the graphic object meta renderer.
protected  void setOverviewRenderer(ilog.cpl.graph.css.renderer.IlpOverviewRenderer overviewRenderer)
           
 void setOverviewVisible(boolean visible)
          Makes the overview visible or invisible.