public class IlvSDMView extends IlvManagerView implements IlvStylable
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:
setModel
.
setXMLFile
and writeXML
.
setStyleSheets
.
setDragEnabled
,
setDropEnabled
), link reconnection (see setLinkReconnectionEnabled
),
and palette management (see setTargetView
).
IlvSDMEngine
,
Serialized FormIlvManagerView.FitAreaCalculator
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
BLINKING_AUTOMATIC, BLINKING_DISABLED, BLINKING_ENABLED, DIRECT_REDRAW, KEY_VIEW, THREADED_REDRAW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
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
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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 Rogue Wave 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.
|
acceptCollapseExpandIconsEvent, addInteractorListener, addManagerChangedListener, addNotify, addTransformer, addTransformerListener, addViewDecoration, computeBBox, computeTransformerFitToArea, createDoubleBufferImage, createImage, doubleBufferedImageUpToDate, ensureVisible, ensureVisible, fitTransformerToArea, fitTransformerToArea, fitTransformerToAreaImpl, fitTransformerToContent, fitTransformerToContent, fitTransformerToContent, fitTransformerToContent, getBackgroundPattern, getBackgroundPatternLocation, getBlinkingMode, getCurrentView, getDefaultGhostColor, getDefaultXORColor, getGrid, getInteractor, getManager, getMaximumSize, getMaxZoomXFactor, getMaxZoomYFactor, getMinimumSize, getMinZoomXFactor, getMinZoomYFactor, getPopupMenu, getPopupMenu, getPreferredSize, getRedrawMode, getRegion, getRepaintSkipThreshold, getStoredULocale, getTransformer, getTripleBufferedLayerCount, getULocale, getViewDecoration, getViewDecorationCount, getViewMargins, imageUpdate, initDisplayInfo, interactorChanged, invalidateRect, invalidateTripleBuffer, invalidateTripleBuffer, invalidateView, isAntialiasing, isAtZoomXFactorLimit, isAtZoomYFactorLimit, isAutoFitToContents, isCollapseExpandIconsEnabled, isContributingToViewBBox, isDoubleBufferFrozen, isDoubleBuffering, isEventDispatching, isInSwingParent, isKeepingAspectRatio, isLayerCached, isOpaque, isOptimizedTranslation, isRegisteredAtToolTipManager, isSelectedWhenPopupPreferred, isTransparent, isVisible, isWheelZoomingEnabled, isWheelZoomingInverted, managerChanged, paint, popInteractor, print, processEvent, processKeyEvent, pushInteractor, pushInteractor, reDrawViews, reDrawViewsForBlinking, removeAllInteractors, removeInteractorListener, removeManagerChangedListener, removeNotify, removeTransformerListener, removeViewDecoration, repaint, repaint, setAntialiasing, setAutoFitToContents, setAutoFitToContents, setBackground, setBackgroundPattern, setBackgroundPatternLocation, setBlinkingMode, setBounds, setCollapseExpandIconsEnabled, setComponentOrientation, setContributingToViewBBox, setCursor, setDefaultGhostColor, setDefaultXORColor, setDoubleBufferFrozen, setDoubleBuffering, setEventDispatching, setGrid, setInteractor, setKeepingAspectRatio, setLayerCached, setLocale, setManager, setMaximumSize, setMaxZoomXFactor, setMaxZoomYFactor, setMinimumSize, setMinZoomXFactor, setMinZoomYFactor, setOptimizedTranslation, setPreferredSize, setRedrawMode, setRegisteredAtToolTipManager, setRepaintSkipThreshold, setSelectedWhenPopupPreferred, setTransformer, setTransparent, setTripleBufferedLayerCount, setULocale, setViewMargins, setVisible, setWheelZoomingEnabled, setWheelZoomingInverted, setZoomFactorRange, snapToGrid, transformerChanged, translate, update, verifyTransformer, visibleRect, zoom
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, isValidateRoot, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBaseline, getBaselineResizeBehavior, 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, 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, revalidate, setBounds, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, removePropertyChangeListener
getCursor, getGraphics, isCursorSet
getComponentOrientation
public IlvSDMView(IlvSDMEngine engine)
engine
- The SDM engine.public IlvSDMView()
public IlvSDMView(IlvSDMModel model)
model
- The SDM model.public IlvSDMEngine getSDMEngine()
public void setSDMEngine(IlvSDMEngine engine)
engine
- The new SDM engine.public IlvSDMModel getModel()
public void setModel(IlvSDMModel model)
model
- The new data model to use.public void setStyleSheets(String[] styleSheet) throws IlvSDMException
setStyleSheets
in interface IlvStylable
styleSheet
- The style sheet (URL, filename, or string).IlvSDMException
IlvSDMEngine.setStyleSheets(java.lang.String[])
public void setStyleSheets(int index, String css) throws IlvSDMException
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.
setStyleSheets
in interface IlvStylable
index
- The index of the style sheet to replace.css
- The URL or file name of the new style sheet file.IlvSDMException
setStyleSheets(java.lang.String[])
public String[] getStyleSheets()
getStyleSheets
in interface IlvStylable
IlvSDMEngine.getStyleSheets(int)
public String getStyleSheets(int index)
getStyleSheets
in interface IlvStylable
index
- The position of the style sheet.index
-th
style sheet.setStyleSheets(java.lang.String[])
,
getStyleSheets()
public void setStyleSheetDebugMask(int v)
setStyleSheets
to debug problems during
configuration. The default value traces bad class names and
"set" methods that raise an exception.setStyleSheetDebugMask
in interface IlvStylable
v
- The debug mask, as defined in IlvStyleSheetRenderer
.IlvStyleSheetRenderer.setDebugMask(int)
,
setStyleSheets(java.lang.String[])
,
getStyleSheetDebugMask()
public int getStyleSheetDebugMask()
getStyleSheetDebugMask
in interface IlvStylable
setStyleSheetDebugMask(int)
public void setXMLFile(String url) throws IlvSDMException, IOException, MalformedURLException
url
- The URL of the XML file.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
public String getXMLFile()
null
if the current model does not support XML, or if
no XML file is currently displayed.public void writeXML(String filename) throws IOException
filename
- The path of the XML file.IOException
- if an error occurred while opening the file or writing the data.public void setDragEnabled(boolean enabled)
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.IlvSDMDragSource
public boolean isDragEnabled()
true
if this view is enabled
as a source for drag-and-drop interactions.setDragEnabled(boolean)
public void setDropEnabled(boolean enabled)
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.IlvSDMDropTarget
public boolean isDropEnabled()
true
if this view is enabled
as a target for drag-and-drop interactions.setDropEnabled(boolean)
public void setLinkReconnectionEnabled(boolean enabled)
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.IlvSDMLinkReconnector
public boolean isLinkReconnectionEnabled()
true
if link reconnection is enabled
in this view.setLinkReconnectionEnabled(boolean)
public void setTargetView(IlvManagerView targetView)
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.targetView
- The target view.IlvSDMPaletteConnector
,
IlvMakeSDMNodeInteractor
,
IlvMakeSDMLinkInteractor
public void setTargetView(IlvManagerView targetView, AWTEvent event)
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.targetView
- The target view.event
- The AWT event that caused the target view to become active.IlvSDMPaletteConnector.setTargetView(ilog.views.IlvManagerView,java.awt.AWTEvent)
public IlvManagerView getTargetView()
setTargetView(ilog.views.IlvManagerView)
public void setUtilitiesFactory(IlvSDMUtilitiesFactory factory)
factory
- The new factory.public IlvSDMUtilitiesFactory getUtilitiesFactory()
public void fitTransformerToContent(Insets insets, int maxNumberOfIterations)
fitTransformerToContent
in class IlvManagerView
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.IlvGraphic.zoomable()
,
IlvManagerView.fitTransformerToContent(Insets)
,
IlvManagerView.fitTransformerToContent(Insets, int, boolean)
,
IlvManagerView.fitTransformerToArea(Insets, FitAreaCalculator, int)
,
IlvManagerView.setAutoFitToContents(boolean)
public IlvRect computeBBox(IlvTransformer t)
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.
computeBBox
in class IlvManagerView
t
- The transformer used to compute the bbox
.
A null
value is equivalent to an identity transformer.IlvManagerView.setViewMargins(java.awt.Insets)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.