ilog.views.sdm
Class IlvSDMView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by ilog.views.IlvManagerView
              extended by ilog.views.sdm.IlvSDMView
All Implemented Interfaces:
IlvObjectInteractorContext, IlvStylable, ImageObserver, MenuContainer, Serializable

public class IlvSDMView
extends IlvManagerView
implements IlvStylable

An IlvSDMView is an IlvManagerView that is connected to an IlvSDMEngine.

An SDM engine can be used with any manager view. This class is simply a convenience front-end that provides an easy access to the following SDM functionalities:

Since:
JViews 4.0
See Also:
IlvSDMEngine, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class ilog.views.IlvManagerView
IlvManagerView.FitAreaCalculator
 
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
 
Fields inherited from class ilog.views.IlvManagerView
DIRECT_REDRAW, THREADED_REDRAW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
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
IlvSDMView()
          Creates a new SDM view.
IlvSDMView(IlvSDMEngine engine)
          Creates an SDM view associated with the specified SDM engine.
IlvSDMView(IlvSDMModel model)
          Creates an SDM view with the specified SDM model.
 
Method Summary
 IlvRect computeBBox(IlvTransformer t)
          Computes the rectangle that contains all the graphic objects of the manager for the view.
 void fitTransformerToContent(Insets insets, int maxNumberOfIterations)
          Overrides to iterate when auto layout on zoom is on.
 IlvSDMModel getModel()
          Returns the current data model.
 IlvSDMEngine getSDMEngine()
          Returns the SDM engine associated with this SDM view.
 int getStyleSheetDebugMask()
          Returns the debug level of the current configuration style sheet.
 String[] getStyleSheets()
          Returns the style sheets used by this SDM view to render the objects of the SDM model.
 String getStyleSheets(int index)
          Returns one of the style sheets used by this SDM engine to map the data model to ILOG JViews graphic objects.
 IlvManagerView getTargetView()
          Returns the target view when this SDM view is used as a palette.
 IlvSDMUtilitiesFactory getUtilitiesFactory()
          Returns the factory that creates the utility objects used by this SDM view.
 String getXMLFile()
          Returns the URL of the XML file currently displayed by the SDM view.
 boolean isDragEnabled()
          Returns true if this view is enabled as a source for drag-and-drop interactions.
 boolean isDropEnabled()
          Returns true if this view is enabled as a target for drag-and-drop interactions.
 boolean isLinkReconnectionEnabled()
          Returns true if link reconnection is enabled in this view.
 void setDragEnabled(boolean enabled)
          Enables or disables this SDM view as a source for drag-and-drop interactions.
 void setDropEnabled(boolean enabled)
          Enables or disables this SDM view as a target for drag-and-drop interactions.
 void setLinkReconnectionEnabled(boolean enabled)
          Enables or disables the interactive reconnection of links displayed in this SDM view.
 void setModel(IlvSDMModel model)
          Changes the data model used by this SDM view.
 void setSDMEngine(IlvSDMEngine engine)
          Changes the SDM engine associated with this SDM view.
 void setStyleSheetDebugMask(int v)
          Sets the debug flag while parsing the configuration style sheet.
 void setStyleSheets(int index, String css)
          Changes one of the cascading style sheets.
 void setStyleSheets(String[] styleSheet)
          Changes the style sheets used by this SDM view to render the objects of the SDM model.
 void setTargetView(IlvManagerView targetView)
          This method lets you use this SDM view as a palette to create objects in another SDM view.
 void setTargetView(IlvManagerView targetView, AWTEvent event)
          This method is similar to setTargetView, except for the additional event parameter.
 void setUtilitiesFactory(IlvSDMUtilitiesFactory factory)
          Changes the factory that creates the utility objects used by this SDM view.
 void setXMLFile(String url)
          Sets the XML file containing the data to display.
 void writeXML(String filename)
          Writes the data contained in the data model of the associated SDM engine to an XML file.
 
Methods inherited from class ilog.views.IlvManagerView
addInteractorListener, addManagerChangedListener, addNotify, addTransformer, addTransformerListener, addViewDecoration, computeBBox, ensureVisible, ensureVisible, fitTransformerToArea, fitTransformerToContent, fitTransformerToContent, getBackgroundPattern, getBackgroundPatternLocation, getDefaultGhostColor, getDefaultXORColor, getGrid, getInteractor, getManager, getMaximumSize, getMaxZoomXFactor, getMaxZoomYFactor, getMinimumSize, getMinZoomXFactor, getMinZoomYFactor, getPopupMenu, getPopupMenu, getPreferredSize, getRedrawMode, getRegion, getRepaintSkipThreshold, getTransformer, getTripleBufferedLayerCount, getViewDecoration, getViewDecorationCount, imageUpdate, initDisplayInfo, interactorChanged, invalidateRect, invalidateTripleBuffer, invalidateTripleBuffer, invalidateView, isAntialiasing, isAtZoomXFactorLimit, isAtZoomYFactorLimit, isAutoFitToContents, isContributingToViewBBox, isDoubleBufferFrozen, isDoubleBuffering, isEventDispatching, isInSwingParent, isKeepingAspectRatio, isLayerCached, isOptimizedTranslation, isTransparent, isVisible, isWheelZoomingEnabled, isWheelZoomingInverted, managerChanged, paint, popInteractor, processEvent, processKeyEvent, pushInteractor, pushInteractor, reDrawViews, removeAllInteractors, removeInteractorListener, removeManagerChangedListener, removeNotify, removeTransformerListener, removeViewDecoration, repaint, repaint, setAntialiasing, setAutoFitToContents, setBackground, setBackgroundPattern, setBackgroundPatternLocation, setBounds, setContributingToViewBBox, setCursor, setDefaultGhostColor, setDefaultXORColor, setDoubleBufferFrozen, setDoubleBuffering, setEventDispatching, setGrid, setInteractor, setKeepingAspectRatio, setLayerCached, setManager, setMaximumSize, setMaxZoomXFactor, setMaxZoomYFactor, setMinimumSize, setMinZoomXFactor, setMinZoomYFactor, setOptimizedTranslation, setPreferredSize, setRedrawMode, setRepaintSkipThreshold, setTransformer, setTransparent, setTripleBufferedLayerCount, setVisible, setWheelZoomingEnabled, setWheelZoomingInverted, setZoomFactorRange, snapToGrid, transformerChanged, translate, update, verifyTransformer, visibleRect, zoom
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ilog.views.util.styling.IlvStylable
addPropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface ilog.views.IlvObjectInteractorContext
getCursor, getGraphics, isCursorSet
 

Constructor Detail

IlvSDMView

public IlvSDMView(IlvSDMEngine engine)
Creates an SDM view associated with the specified SDM engine.

Parameters:
engine - The SDM engine.

IlvSDMView

public IlvSDMView()
Creates a new SDM view. A new SDM engine is created and associated with the view.


IlvSDMView

public IlvSDMView(IlvSDMModel model)
Creates an SDM view with the specified SDM model.

Parameters:
model - The SDM model.
Method Detail

getSDMEngine

public IlvSDMEngine getSDMEngine()
Returns the SDM engine associated with this SDM view.


setSDMEngine

public void setSDMEngine(IlvSDMEngine engine)
Changes the SDM engine associated with this SDM view.

Parameters:
engine - The new SDM engine.

getModel

public IlvSDMModel getModel()
Returns the current data model.

Returns:
The current data model.

setModel

public void setModel(IlvSDMModel model)
Changes the data model used by this SDM view.

Parameters:
model - The new data model to use.

setStyleSheets

public void setStyleSheets(String[] styleSheet)
                    throws IlvSDMException
Changes the style sheets used by this SDM view to render the objects of the SDM model.

Specified by:
setStyleSheets in interface IlvStylable
Parameters:
styleSheet - The style sheet (URL, filename, or string).
Throws:
IlvSDMException
See Also:
IlvSDMEngine.setStyleSheets(java.lang.String[])

setStyleSheets

public void setStyleSheets(int index,
                           String css)
                    throws IlvSDMException
Changes one of the cascading style sheets. This method is an alternative to setStyleSheets(java.lang.String[]): it lets you change one particular style sheet file, instead of setting the whole style sheet array.

This call will reload the data model and re-create all the graphic objects. Warning, this method will override the current renderer.

Specified by:
setStyleSheets in interface IlvStylable
Parameters:
index - The index of the style sheet to replace.
css - The URL or file name of the new style sheet file.
Throws:
IlvSDMException
Since:
JViews 5.5
See Also:
setStyleSheets(java.lang.String[])

getStyleSheets

public String[] getStyleSheets()
Returns the style sheets used by this SDM view to render the objects of the SDM model.

Specified by:
getStyleSheets in interface IlvStylable
Returns:
An array containing the URLs or file names of the style sheets.
See Also:
IlvSDMEngine.getStyleSheets(int)

getStyleSheets

public String getStyleSheets(int index)
Returns one of the style sheets used by this SDM engine to map the data model to ILOG JViews graphic objects.

Specified by:
getStyleSheets in interface IlvStylable
Parameters:
index - The position of the style sheet.
Returns:
The URL or file name of the index-th style sheet.
Since:
JViews 5.5
See Also:
setStyleSheets(java.lang.String[]), getStyleSheets()

setStyleSheetDebugMask

public void setStyleSheetDebugMask(int v)
Sets the debug flag while parsing the configuration style sheet. Set this property before calling setStyleSheets to debug problems during configuration. The default value traces bad class names and "set" methods that raise an exception.

Specified by:
setStyleSheetDebugMask in interface IlvStylable
Parameters:
v - The debug mask, as defined in IlvStyleSheetRenderer.
Since:
JViews 5.5
See Also:
IlvStyleSheetRenderer.setDebugMask(int), setStyleSheets(java.lang.String[]), getStyleSheetDebugMask()

getStyleSheetDebugMask

public int getStyleSheetDebugMask()
Returns the debug level of the current configuration style sheet.

Specified by:
getStyleSheetDebugMask in interface IlvStylable
Since:
JViews 5.5
See Also:
setStyleSheetDebugMask(int)

setXMLFile

public void setXMLFile(String url)
                throws IlvSDMException,
                       IOException,
                       MalformedURLException
Sets the XML file containing the data to display.

Parameters:
url - The URL of the XML file.
Throws:
IlvSDMException - if the current data model does not support XML reading, or if an error occurred while opening or reading the XML file.
IOException
MalformedURLException

getXMLFile

public String getXMLFile()
Returns the URL of the XML file currently displayed by the SDM view.

Returns:
A URL (as a String), or null if the current model does not support XML, or if no XML file is currently displayed.

writeXML

public void writeXML(String filename)
              throws IOException
Writes the data contained in the data model of the associated SDM engine to an XML file.

Parameters:
filename - The path of the XML file.
Throws:
IOException - if an error occurred while opening the file or writing the data.

setDragEnabled

public void setDragEnabled(boolean enabled)
Enables or disables this SDM view as a source for drag-and-drop interactions.

Parameters:
enabled - If true, it is possible to drag an object from this view to another SDM view. The target view must be enabled as a drop target with setDropEnabled. If false, objects cannot be dragged from this view.
See Also:
IlvSDMDragSource

isDragEnabled

public boolean isDragEnabled()
Returns true if this view is enabled as a source for drag-and-drop interactions.

See Also:
setDragEnabled(boolean)

setDropEnabled

public void setDropEnabled(boolean enabled)
Enables or disables this SDM view as a target for drag-and-drop interactions.

Parameters:
enabled - If true, it is possible to drop an object to this view from another SDM view. The source view must be enabled as a drag source with setDragEnabled. If false, objects cannot be dropped to this view.
See Also:
IlvSDMDropTarget

isDropEnabled

public boolean isDropEnabled()
Returns true if this view is enabled as a target for drag-and-drop interactions.

See Also:
setDropEnabled(boolean)

setLinkReconnectionEnabled

public void setLinkReconnectionEnabled(boolean enabled)
Enables or disables the interactive reconnection of links displayed in this SDM view.

Parameters:
enabled - If true, it is possible to reconnect links displayed in this view by dragging their extremities. A link can be reconnected either to another existing node, or at an "empty" location in the view: in that case, the link is connected to a special anchor object that is automatically created. If false, links cannot be reconnected in this view.
See Also:
IlvSDMLinkReconnector

isLinkReconnectionEnabled

public boolean isLinkReconnectionEnabled()
Returns true if link reconnection is enabled in this view.

See Also:
setLinkReconnectionEnabled(boolean)

setTargetView

public void setTargetView(IlvManagerView targetView)
This method lets you use this SDM view as a palette to create objects in another SDM view. When the target view is set, clicking in an object of this view will attach an IlvMakeSDMNodeInteractor or an IlvMakeSDMLinkInteractor to the target view, depending on the type of the selected object. The user must then click in the target view to create the new node or the new link.

Parameters:
targetView - The target view.
See Also:
IlvSDMPaletteConnector, IlvMakeSDMNodeInteractor, IlvMakeSDMLinkInteractor

setTargetView

public void setTargetView(IlvManagerView targetView,
                          AWTEvent event)
This method is similar to setTargetView, except for the additional event parameter. This event is typically a mouse click that caused the target view to become active in a multidocument application. The event will be dispatched right away to the new SDM object creation interactor, so that you can change the active view and create the object in a single click.

Parameters:
targetView - The target view.
event - The AWT event that caused the target view to become active.
See Also:
IlvSDMPaletteConnector.setTargetView(ilog.views.IlvManagerView,java.awt.AWTEvent)

getTargetView

public IlvManagerView getTargetView()
Returns the target view when this SDM view is used as a palette.

See Also:
setTargetView(ilog.views.IlvManagerView)

setUtilitiesFactory

public void setUtilitiesFactory(IlvSDMUtilitiesFactory factory)
Changes the factory that creates the utility objects used by this SDM view. You can call this method if you need to create modified versions of the utility objects used by this SDM view.

Parameters:
factory - The new factory.

getUtilitiesFactory

public IlvSDMUtilitiesFactory getUtilitiesFactory()
Returns the factory that creates the utility objects used by this SDM view.


fitTransformerToContent

public void fitTransformerToContent(Insets insets,
                                    int maxNumberOfIterations)
Overrides to iterate when auto layout on zoom is on.

Overrides:
fitTransformerToContent in class IlvManagerView
Parameters:
insets - The margins around the manager's contents. Set this value to null for no margins.
maxNumberOfIterations - The maximum number of iterations to be used for computing the optimal transformer.
Since:
JViews 8.1
See Also:
IlvGraphic.zoomable(), IlvManagerView.setAutoFitToContents(boolean), IlvManagerView.fitTransformerToContent(), IlvManagerView.fitTransformerToContent(Insets)

computeBBox

public IlvRect computeBBox(IlvTransformer t)
Computes the rectangle that contains all the graphic objects of the manager for the view. Layers that are not visible for the view are not taken into account.

This method calls the SDM renderer's IlvSDMRenderer.computeBBox(ilog.views.sdm.IlvSDMEngine, ilog.views.IlvManagerView, ilog.views.IlvTransformer), to give the SDM renderers a chance to return a custom bounding rectangle.

Overrides:
computeBBox in class IlvManagerView
Parameters:
t - The transformer used to compute the bbox. A null value is equivalent to an identity transformer.
Returns:
The resulting rectangle.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.