public class TNetwork
extends javax.swing.JComponent
implements twaver.base.obfuscate.view.Network
Representation objects to be displayed in this component is Element
,
which must added into the TDataBox
which act as the model of network
component. The main subclass of element is Node
and Link
.
Developer can subclass and customize element object to display different things.
Network use a renderer object to render all elements. Developer can extends element object to represent a business object, and use a specified renderer to render this elements. With is MVC architecture, it's more easy to extend new features.
Network use a input event listener to handle all kinds of interactions. TWaver provide a default listener which provide selection, zooming, drag&drop, pan etc. For more complicated or customized behaviors, developer can subclass or implements specified class or interface.
The TNetwork
has many facilities that make it possible to customize
its rendering and behaviors, but provides defaults for these features so that
simple networks can be set up easily. For example, to set up a empty network:
TDataBox box = new TDataBox(); TNetwork network = new TNetwork(box);
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
java.util.List |
_A |
static int |
CONTAIN_SELECTION
Contain selection mode.
|
protected Element |
exportingElement |
static int |
INTERSECT_SELECTION
Intersect selection mode.
|
static int |
MIX_SELECTION
Mix selection mode.
|
static int |
PAINT_STATE_DEFAULT |
static int |
PAINT_STATE_EXPORT |
static int |
PAINT_STATE_OVERVIEW |
static int |
PAINT_STATE_PRINT |
static int |
PAINT_STATE_PRINT_PREVIEW |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
TNetwork()
Constructs a
TNetwork object initialized with a default
data box created inside the initialization. |
TNetwork(TDataBox box)
Constructs a
TNetwork object initialized with an explicit
data box. |
Modifier and Type | Method and Description |
---|---|
void |
addBackgroundDoubleClickedActionListener(java.awt.event.ActionListener l)
Adds an action on the network bound to background double click event.
|
void |
addCanvasCushion(CanvasCushion canvasCushion)
Adds a new canvas cushion to this network.
|
void |
addCanvasMarker(CanvasMarker m)
Adds a canvas marker on this network.
|
void |
addCanvasPaintListener(CanvasPaintListener l)
Adds a canvas paint listener for this network.
|
void |
addComponentOnCanvas(javax.swing.JComponent component,
int anchor) |
void |
addElementClickedActionListener(java.awt.event.ActionListener l)
Adds an element clicked action listener.
|
void |
addElementDoubleClickedActionListener(java.awt.event.ActionListener l)
Adds an element double click action listener to the network.
|
void |
addElementToCurrentSubNetwork(Element element)
Adds a new element to the data box connected with this network.
|
void |
addInteractionListener(InteractionListener listener)
Adds an interaction listener on the network.
|
void |
addMovableFilter(MovableFilter filter)
Adds a new movable filter into this network.
|
void |
addSelectableFilter(SelectableFilter filter)
Adds a new selectable filter into this network.
|
void |
addVisibleFilter(VisibleFilter filter)
Adds a visible filter into this network.
|
boolean |
adjustCanvasSize()
Calls this method to adjust network canvas size
to its preferred size.
|
boolean |
adjustCanvasSize(Element element)
Packs canvas by given element.
|
boolean |
adjustCanvasSize(int maxX,
int maxY)
Adjusts canvas bounds according to the given values.
|
boolean |
adjustCanvasSize(java.awt.Point point)
Adjusts the canvas area size according to the specified point
For drag&drop or other reason, canvas size should adjusted dynamically.
|
void |
adjustComponentPosition(javax.swing.JComponent component)
Adjusts the specified component position,
avoid the component's location is out of the scroll view port.
|
void |
animateCurrentSubNetwork(TSubNetwork subNetwork)
Sets current subnetwork animately.
|
void |
animateCurrentSubNetwork(TSubNetwork subNetwork,
java.lang.Runnable runnable,
int step,
int sleep)
Sets current subnetwork animately.
|
void |
appendSelection(Element element)
Keeps current selection and makes given element selected.
|
void |
centerElement(Element element)
Scrolls the network canvas viewport to view the given element
in the center of viewport.
|
void |
clearMovableFilters()
Clears all movable filters from this network.
|
void |
clearSelection()
Unselected all selected elements.
|
protected javax.swing.JToolTip |
createCanvasToolTip() |
ElementUI |
createElementUI(Element element)
Creates element ui instance for the given element instance.
|
void |
dispose()
Disposes this network and release any resources that it is using.
|
boolean |
doLayout(int type)
Calls this method to make the elements to do auto layout on the network canvas.
|
boolean |
doLayout(int type,
boolean animated)
Calls this method to make the elements to do auto layout on the network canvas.
|
boolean |
doLayout(int type,
boolean animated,
java.lang.Runnable runnable)
Calls this method to make the elements to do auto layout on the network canvas.
|
boolean |
doLayout(int type,
boolean animated,
java.lang.Runnable runnable,
Generator elementSizeGenerator)
Calls this method to make the elements to do auto layout on the network canvas.
|
boolean |
doLayout(java.util.Iterator elements,
int type,
boolean animated,
java.lang.Runnable runnable,
int xOffset,
int yOffset,
Generator elementSizeGenerator)
Calls this method to make given elements to do auto layout on the network canvas.
|
protected void |
dropComplete(java.awt.dnd.DropTargetDropEvent e,
Element element) |
void |
ensureVisible(Element element)
Scrolls network viewport to ensure the given
element is appeared on network canvas.
|
void |
ensureVisible(java.awt.Rectangle bounds)
Scrolls network viewport to ensure the given
region is appear on network canvas.
|
void |
exitFullScreen()
Calls this method to exit full screen mode.
|
boolean |
exportCoverElementsToImageIcon(java.lang.String iconUrl,
java.lang.String formatName,
int margin,
double zoom) |
boolean |
exportDividedImages(java.lang.String fileName,
java.lang.String format,
int rowCount,
int columnCount,
double zoom)
Exports network images dividedly.
|
boolean |
exportElementsToFile(Generator fileNameGenerator,
java.lang.String formatName,
int margin,
double zoom) |
boolean |
exportElementsToImageIcon(Generator iconUrlGenerator,
java.lang.String formatName,
int margin,
double zoom) |
boolean |
exportElementToFile(Element element,
java.lang.String fileName,
java.lang.String formatName,
int margin,
double zoom) |
boolean |
exportElementToImageIcon(Element element,
java.lang.String iconUrl,
java.lang.String formatName,
int margin,
double zoom) |
boolean |
exportImage(java.io.OutputStream outputStream,
java.lang.String formatName,
java.awt.Rectangle logicalBounds,
double zoom)
Exports the specified logical bounds of network canvas image date into given output stream.
|
void |
exportImage(java.lang.String fileName)
Exports network canvas into the specified JPG file.
|
boolean |
exportImage(java.lang.String fileName,
java.lang.String formatName)
Exports network canvas into specified file.
|
boolean |
exportImage(java.lang.String fileName,
java.lang.String formatName,
double zoom)
Exports network canvas into specified file.
|
boolean |
exportImage(java.lang.String fileName,
java.lang.String formatName,
java.awt.Rectangle logicalBounds,
double zoom)
Exports the specified logical bounds of network canvas to image file.
|
boolean |
exportImageCoverElements(java.lang.String fileName,
java.lang.String formatName,
int margin)
Exports the elements cover area on the network canvas into specified file.
|
boolean |
exportImageCoverElements(java.lang.String fileName,
java.lang.String formatName,
int margin,
double zoom)
Exports the elements cover area on the network canvas into specified file.
|
void |
exportSVG(java.lang.String fileName)
Exports the content on the current network canvas to file in SVG format.
|
boolean |
exportToImageIcon(java.lang.String iconUrl,
java.lang.String formatName,
double zoom) |
boolean |
exportToImageIcon(java.lang.String iconUrl,
java.lang.String formatName,
java.awt.Rectangle logicalBounds,
double zoom) |
void |
fireBackgroundDoubleClicked(MouseActionEvent event)
Fires an event to inform listeners that the background is double clicked.
|
void |
fireElementClicked(MouseActionEvent event)
Fires element clicked event.
|
void |
fireElementDoubleClicked(MouseActionEvent event)
Fires element double clicked event.
|
void |
fireInteractionPerformed(InteractionEvent event)
Fires an interaction perform event.
|
void |
fireInteractionPerformed(java.lang.Object source,
int type,
int index,
java.awt.event.MouseEvent mouseEvent)
Fires a interaction event.
|
void |
fireInteractionPerformed(java.lang.Object source,
int type,
java.awt.event.MouseEvent mouseEvent)
Fires a interaction event.
|
boolean |
forceAdjustCanvasSize()
Calls this method to adjust network canvas size
to its preferred size.
|
Generator |
getAlarmColorGenerator()
Gets the alarm color generator for this network.
|
Generator |
getAlarmLabelGenerator()
Gets the alarm label generator for this network.
|
float |
getAlpha()
Gets the alpha transparent value for network canvas.
|
java.util.List |
getBackgroundDoubleClickedActionListeners()
Gets all background double clicked action listeners.
|
BlinkingRule |
getBlinkingRule()
Gets blinking rule for this network component.
|
javax.swing.JComponent |
getCanvas()
Gets the canvas of the network.
|
java.util.List |
getCanvasCushions()
Gets all canvas cushions that added to this network.
|
java.util.List |
getCanvasMarkers()
Gets all canvas markers that added to this network.
|
java.util.List |
getCanvasPaintListeners()
Gets all canvas paint listeners for this network.
|
javax.swing.JScrollPane |
getCanvasScrollPane()
Gets the canvas scroll pane.
|
java.awt.Dimension |
getCanvasSize()
Returns the canvas area size.
|
protected java.lang.String |
getCanvasToolTipText(java.awt.event.MouseEvent e)
Gets canvas tooltip text via specified mouse event.
|
InteractionMode |
getCreateLinkMode(java.lang.Class linkType) |
Background |
getCurrentBackground()
Gets the current displaying background of this network.
|
TSubNetwork |
getCurrentSubNetwork()
Gets the current subnetwork.
|
TDataBox |
getDataBox()
Gets the connected databox.
|
javax.swing.ButtonGroup |
getDefaultButtonGroup()
Gets the default button group of this network's toolbar.
|
java.awt.Cursor |
getDefaultCursor() |
Overview |
getDefaultOverview()
Gets the default overview of this network.
|
DoubleClickableFilter |
getDoubleClickableFilter()
Gets the element double clickable filter for the network.
|
int |
getDragCriticalValue()
Gets the distance critical value for starting to drag.
|
DraggingSpeed |
getDraggingSpeed()
Returns the moving speed in the network, when user is dragging
the element exceed the bounds of network's visible region.
|
Generator |
getElementBodyColorGenerator()
Returns the element body color generator for this network.
|
java.awt.Rectangle |
getElementBounds(Element element)
Gets specified element's bounds information.
|
java.util.Map |
getElementBoundsCache() |
ElementBoundsInvalidatableFilter |
getElementBoundsInvalidatableFilter()
Gets element bounds invalidate filter installed on the network.
|
java.util.List |
getElementClickedActionListeners()
Gets all element clicked action listeners.
|
java.util.List |
getElementDoubleClickedActionListeners()
Gets all element double clicked action listeners.
|
EditableFilter |
getElementLabelEditableFilter()
Gets element label editable filter.
|
ElementLabelEditor |
getElementLabelEditor()
Gets element label editor.
|
Generator |
getElementLabelGenerator()
Returns the label generator for this network.
|
LabelInputField |
getElementLabelInputField()
Gets the label input field of this network.
|
Element |
getElementLogicalAt(int x,
int y)
Gets the first element contains specified point.
|
Element |
getElementLogicalAt(java.awt.geom.Point2D p)
Gets the first element contains specified point.
|
Element |
getElementPhysicalAt(int x,
int y)
Gets element located given physical location.
|
Element |
getElementPhysicalAt(java.awt.Point p)
Gets element located given physical location.
|
ElementPropertyChangeRepaintFilter |
getElementPropertyChangeRepaintFilter()
Gets element property change repaint filter.
|
java.util.List |
getElementsAt(java.awt.Rectangle rect,
boolean isIntersectSelection)
Gets all visible elements in specified rectangle.
|
java.awt.Color |
getElementSelectColor(Element element)
Gets the given element's selection highlight color.
|
Generator |
getElementSelectColorGenerator()
Returns the element selected color generator for this network.
|
java.util.List |
getElementsLogicalAt(int x,
int y) |
java.util.List |
getElementsLogicalAt(int x,
int y,
boolean selectable)
Gets all elements located at the given logical point.
|
java.util.List |
getElementsLogicalAt(java.awt.Point p) |
java.util.List |
getElementsLogicalAt(java.awt.Point p,
boolean selectable)
Gets all elements located at the given logical point.
|
java.util.List |
getElementsPhysicalAt(int x,
int y)
Gets all elements located at given physical location.
|
java.util.List |
getElementsPhysicalAt(java.awt.Point p)
Gets all elements located at given physical point.
|
Generator |
getElementStateOutlineColorGenerator()
Returns the element state outline color generator for this network.
|
Generator |
getElementToolTipTextGenerator()
Returns the tooltip text generator for this network.
|
ElementUI |
getElementUI(Element element)
Gets UI instance for the given element.
|
Generator |
getGroupChildBoundsGenerator()
Returns the group child bounds generator for this network.
|
InteractionMode |
getInteractionMode()
Gets current network interaction mode.
|
Element |
getLastSelectedElement()
Gets the last selected element on network, if exist.
|
javax.swing.JLayeredPane |
getLayeredPane()
Gets the internal layered pane of network.
|
LinkLayouter |
getLinkLayouter()
Gets the link layouter object of this network.
|
java.awt.Rectangle |
getLogicalBounds(java.awt.Rectangle physicalRect)
Gets logical rectangle by given physical rectangle.
|
java.awt.Point |
getLogicalCenterPoint()
Gets logical center point for current network canvas.
|
java.awt.Point |
getLogicalPoint(java.awt.Point physicalPoint)
Gets logical point by given phsical point.
|
java.awt.Dimension |
getLogicalSize()
Gets network logical size.
|
Magnifier |
getMagnifier()
Gets the magnifier of this network .
|
Generator |
getMessageContentGenerator()
Gets the message content generator for this network.
|
int |
getMinLayoutXOffset() |
int |
getMinLayoutYOffset() |
java.util.List |
getMovableFilters()
Gets all movable filters of this network.
|
Background |
getNetworkBackground()
Gets the network background object.
|
PaintAttachmentFilter |
getPaintAttachmentFilter() |
java.util.ListIterator |
getPaintElementIterator()
Internal use only
|
PaintSelectionStateFilter |
getPaintSelectionStateFilter()
Gets the paint selection state filter for this network.
|
int |
getPaintState() |
int |
getParallelLinkGap()
Gets the parallel link gap.
|
int |
getParallelLinkOffset()
Gets the parallel link offset
|
java.awt.Rectangle |
getPhysicalBounds(java.awt.Rectangle logicalRect)
Gets physical rectangle by given logical rectangle.
|
java.awt.Point |
getPhysicalCenterPoint()
Gets physical center point for current network canvas.
|
java.awt.Point |
getPhysicalPoint(java.awt.Point logicalPoint)
Gets physical point by given logical point.
|
PopupMenuFactory |
getPopupMenuFactory()
Gets this network popup menu factory.
|
PopupMenuGenerator |
getPopupMenuGenerator()
Gets popup menu generator for network canvas.
|
NetworkPrinter |
getPrinter()
Gets network printer.
|
NetworkElementRenderer |
getRenderer()
Gets the element renderer of this network.
|
ResizableFilter |
getResizableFilter()
Gets the resizable filter of this network.
|
java.util.List |
getSelectableFilters()
Gets all selectable filters that added to this network.
|
Element |
getSelectedElementLogicalAt(int x,
int y)
Gets the first selected element at the logical position.
|
Element |
getSelectedElementPhysicalAt(int x,
int y)
Gets the first selected element at the given location.
|
Element |
getSelectedElementPhysicalAt(java.awt.Point p)
Gets the first selected element at the given location.
|
int |
getSelectionMode()
Gets network selection mode.
|
DataBoxSelectionModel |
getSelectionModel()
Gets network connected databox selection model.
|
SendToTopFilter |
getSendToTopFilter()
Gets send-to-top filter on the network.
|
SpringLayouter |
getSpringLayouter()
Gets the spring layouter object of this network.
|
int |
getStraightLinkGap()
Gets the straight link gap.
|
int |
getStraightLinkOffset()
Gets the straight link offset.
|
javax.swing.JToolBar |
getToolbar()
Gets network toolbar object.
|
javax.swing.AbstractButton |
getToolbarButtonByName(java.lang.String buttonName)
Gets the button on the toolbar with the given name.
|
java.awt.Point |
getViewPoint()
Gets the top level topology's view port.
|
java.util.List |
getVisibleFilters()
Gets all the visible filters that added to this network.
|
double |
getZoom()
Gets current network canvas zoom factor.
|
Zoomer |
getZoomer()
Gets the network zoomer.
|
void |
handleDrop(java.awt.dnd.DropTargetDropEvent e,
java.lang.String className) |
protected void |
handleElementPropertyChange(java.beans.PropertyChangeEvent e) |
protected void |
initDnD() |
void |
invalidateAllElementBounds()
Invalidates all element's cached bounds value.
|
void |
invalidateAllLinkShape() |
void |
invalidateElementBounds(Element element)
Invalidates the specified element cached bounds value.
|
boolean |
isAlarmBalloonVisible()
Determines whether the alarm balloon attachment is visible on network canvas.
|
boolean |
isAnimateComponentAttachment()
Checks whether enable animate effect on component attachment
|
boolean |
isAnimateElementDelete()
Checks whether enable animate effect when element is deleted.
|
boolean |
isAnimateElementMove()
Checks whether enable animate effect when element is moved.
|
boolean |
isAnimateElementResize()
Checks whether enable animate effect when element is resized.
|
boolean |
isAnimateSubnetworkEnter()
Checks whether enable animate effect when enter subnetwork.
|
boolean |
isApplyBackgroundThroughSubNetwork()
Determines whether this network's background is applied to all subnetworks
that have no assigned background.
|
boolean |
isClearSelectionOnMarginClicked()
If this value is true, click blank area on network will clear all current seleciton;
If this value is false, click blank area on network will not clear current selection.
|
boolean |
isConsiderAttachmentOnLayout()
Determines whether to consider attachment size when doing auto layout.
|
boolean |
isDoubleClickable(Element element)
Checks whether the given element is double clickable on this network.
|
boolean |
isElementTransparentAreaSelectable()
Whether click the element image transparent area is able to select the element.
|
boolean |
isEnableAnimation()
Determines whether to enable animation on this network canvas.
|
boolean |
isEnableAttachmentDefaultAction()
Determines whether the default action on attachment should be enable.
|
boolean |
isEnableAutoAdjustCanvasSize()
Returns true if this network canvas needs to to be adjusted automatically
when something that affects the canvas view size happened, such as element's
location changed, element is removed or added, zoom in or zoom out, etc.
|
boolean |
isEnableAutoScroll()
Checks whether network canvas viewport is automatically scrolled
when element(s) is dragging.
|
boolean |
isEnableBlinking()
Sets whether to enable blinking on this network canvas.
|
boolean |
isEnableCopyPasteWithKeyboard()
Determines Whether network enable copy and paste elements with keyboard.
|
boolean |
isEnableDeleteWithKeyboard()
Determines Whether network enable delete elements with keyboard.
|
boolean |
isEnableDoubleClickToUp()
If this value is true, then double click network canvas blank
area will goto upper subnetwork layer, false will do nothing.
|
boolean |
isEnableEnterEmptySubNetwork()
If this value is true, then empty subnetwork can be drill down,
false can not.
|
boolean |
isEnableExitFullScreenWithKeyboard()
Determines Whether network enable exit full screen with keyboard.
|
boolean |
isEnableIllegalLinkVisible()
Checks whether the illegal links are visible.
|
boolean |
isEnableMouseWheelToZoom()
Checks whether enable scrolling mouse wheel to zoom in/out.
|
boolean |
isEnableRightClickEvent() |
boolean |
isEnableSelectAllWithKeyboard()
Determines Whether network enable select all elements with keyboard.
|
boolean |
isEnableSwitchFullScreenWithKeyboard()
Determines Whether network enable switch full screen with keyboard.
|
boolean |
isEnableUndoRedoWithKeyboard()
Determines Whether network enable undo and redo elements with keyboard.
|
boolean |
isEnsureVisibleOnSelected()
Returns true if need to ensure element visible when selected.
|
boolean |
isExpandGroupAfterLayout()
Determines whether to expand group after doing layout.
|
boolean |
isFrozeLinkShape() |
boolean |
isFullScreen()
Checks whether this network is in full screen mode.
|
boolean |
isLayoutGroupRecursively() |
boolean |
isLimitElementInPositiveLocation()
Returns whether the elements can moved to the positive location such as (-100,-100).
|
boolean |
isLinkBundleAlternate() |
boolean |
isLinkBundleCompact()
Checks whether bundled links is compact style.
|
boolean |
isMovable(Element element)
Checks whether the element is movable on this network canvas.
|
boolean |
isPaintable(Attachment attachment) |
boolean |
isPaintBackground() |
boolean |
isResizable(Element element)
Returns true if the specified element can be resized in the network.
|
boolean |
isSelectable(Element element)
Checks whether the element is selectable on this network canvas.
|
boolean |
isSelectableOnRightClick()
If this return true, right click mouse will select the clicked element;
if this return false, right click mouse will not select the clicked element.
|
boolean |
isSelectedStatePaintable(Element element)
Returns true if element selected state is paintable, flase otherwise.
|
boolean |
isShowLinkBundleHandler()
Determines whether the link bundle handler should be shown on network canvas.
|
boolean |
isShowPlainElement()
Determines whether elements on canvas should be rendered body color
and state outline color.
|
boolean |
isVisible(Element element)
Checks whether the element is visible on this network canvas.
|
void |
layoutToOverview()
Calls this method to make all visible and movable elements on
current network canvas to be layouted to fill the overview size.
|
void |
layoutToOverview(boolean considerZoom)
Calls this method to make all visible and movable elements on
current network canvas to be layouted to fill the overview size.
|
void |
layoutToOverview(boolean considerZoom,
boolean animate)
Calls this method to make all visible and movable elements on
current network canvas to be layouted to fill the overview size.
|
void |
layoutToOverview(boolean considerZoom,
boolean animate,
boolean distort)
Calls this method to make all visible and movable elements on
current network canvas to be layouted to fill the overview size.
|
void |
layoutToOverview(boolean considerZoom,
boolean animate,
boolean distort,
double xscale,
double yscale)
Calls this method to make all visible and movable elements on
current network canvas to be layouted to fill the overview size.
|
void |
loadAndEnterSubNetwork(TSubNetwork subNetwork)
Loads the given subnetwork's descendant content, and makes it
become the current subnetwork of this network.
|
void |
moveSelectedElements(double xOffset,
double yOffset)
Calls this method to move all selected elements by given x offset and y offset.
|
void |
moveSelectedElements(double xOffset,
double yOffset,
java.lang.Runnable runnable,
int stepSize,
int sleep)
Calls this method to move all selected elements by given x offset and y offset.
|
void |
paintComponent(java.awt.Graphics g,
java.awt.Component c,
int x,
int y,
int w,
int h)
Paints a cell renderer component c on graphics object g of network canvas.
|
void |
paintComponent(java.awt.Graphics g,
java.awt.Component c,
java.awt.Rectangle bounds)
Paints a cell renderer component c on graphics object g of network canvas.
|
void |
paintNetworkContent(java.awt.Graphics g,
double xScale,
double yScale,
boolean considerClipBounds)
Calls this method to paint network content on the specified graphics.
|
void |
panCanvas(int xOffset,
int yOffset)
Pans the network view to specified offsets.
|
void |
pasteElements()
Pastes all copied elements to the data box connected with this network.
|
void |
removeBackgroundDoubleClickedActionListener(java.awt.event.ActionListener l)
Removes a specified background double click action listener from network.
|
void |
removeCanvasCushion(CanvasCushion canvasCushion)
Removes a given canvas cushion from this network.
|
void |
removeCanvasMarker(CanvasMarker m)
Removes a specified canvas marker from this network.
|
void |
removeCanvasPaintListener(CanvasPaintListener l)
Removes a canvas paint listener from this network.
|
void |
removeElementClickedActionListener(java.awt.event.ActionListener l)
Removes element clicked action listener from network.
|
void |
removeElementDoubleClickedActionListener(java.awt.event.ActionListener l)
Removes the element double click actin listener from network.
|
void |
removeInteractionListener(InteractionListener listener)
Removes the interaction listener from network.
|
void |
removeMovableFilter(MovableFilter filter)
Removes a movable filter from this network.
|
void |
removeSelectableFilter(SelectableFilter filter)
Removes a selectable filter from this network.
|
void |
removeSelection(Element element)
Unselects given element.
|
void |
removeVisibleFilter(VisibleFilter filter)
Removes a visible filter from this network.
|
void |
repaint(Element element)
Repaints the given element area on network canvas.
|
void |
saveCurrentBrowserRecord()
Calls this method to save current zoom environment into a record.
|
void |
saveCurrentSubNetwork(java.lang.String fileName)
Saves current subnetwork data into the specified file in XML format.
|
void |
saveCurrentSubNetwork(java.lang.String fileName,
boolean withElementID,
boolean withAlarmState)
Saves current subnetwork data into the specified file in XML format.
|
void |
selectAll()
Selects all elements on the network.
|
java.util.Iterator |
selection()
Returns an iterator for all selected elements.
|
void |
setAlarmBalloonVisible(boolean alarmBalloonVisible)
Sets whether the alarm balloon attachment is visible on network canvas.
|
void |
setAlarmColorGenerator(Generator alarmColorGenerator)
Sets a new alarm color generator for this network.
|
void |
setAlarmLabelGenerator(Generator alarmLabelGenerator)
Sets a new alarm label generator for this network.
|
void |
setAlpha(float alpha)
Sets a new alpha transparent value for network canvas.
|
void |
setAnimateComponentAttachment(boolean animateComponentAttachment)
Determines whether enable animate effect on component attachment
|
void |
setAnimateElementDelete(boolean animateElementDelete)
Determines whether enable animate effect when element is deleted.
|
void |
setAnimateElementMove(boolean animateElementMove)
Determines whether enable animate effect when element is moved.
|
void |
setAnimateElementResize(boolean animateElementResize)
Determines whether enable animate effect when element is resized.
|
void |
setAnimateSubnetworkEnter(boolean animateSubnetworkEnter)
Determines whether enable animate effect when enter subnetwork.
|
void |
setApplyBackgroundThroughSubNetwork(boolean applyBackgroundThroughSubNetwork)
Sets whether this network's background is applied to all subnetworks
that have no assigned background.
|
void |
setBackground(Background background)
Sets the network background.
|
void |
setBlinkingRule(BlinkingRule blinkingRule)
Sets an blinking rule for this network component.
|
void |
setClearSelectionOnMarginClicked(boolean isClearSelectionOnMarginClicked)
Sets this value to true, if you want click blank area on network to clear all current seleciton;
Sets this value to false, if you want click blank area on network not clear current selection.
|
void |
setColorBackground(java.awt.Color color)
Sets a color background with a given color.
|
void |
setConsiderAttachmentOnLayout(boolean considerAttachmentOnLayout)
Sets whether to consider attachment size when doing auto layout.
|
void |
setCurrentBackground(Background background)
Sets current displaying background for network.
|
void |
setCurrentSubNetwork(TSubNetwork subNetwork)
Sets new subnetwork.
|
void |
setDataBox(TDataBox box)
Sets databox for this network.
|
void |
setDefaultCursor(java.awt.Cursor defaultCursor) |
void |
setDoubleClickableFilter(DoubleClickableFilter doubleClickableFilter)
Sets a new element double clickable filter for the network.
|
void |
setDragCriticalValue(int dragCriticalValue)
Sets the distance critical value for starting to drag.
|
void |
setDraggingSpeed(DraggingSpeed draggingSpeed)
Sets the the moving speed in the network,when user is dragging
the element exceed the bounds of network's visible region.
|
void |
setElementBodyColorGenerator(Generator elementBodyColorGenerator)
Sets a new element body color generator for this network.
|
void |
setElementBoundsInvalidatableFilter(ElementBoundsInvalidatableFilter filter)
Installs the element bounds invalidatable filter for this network.
|
void |
setElementLabelEditableFilter(EditableFilter elementLabelEditableFilter)
Sets element label editable filter.
|
void |
setElementLabelEditor(ElementLabelEditor elementLabelEditor)
Sets element label editor.
|
void |
setElementLabelGenerator(Generator elementLabelGenerator)
Sets a new label generator for this network.
|
void |
setElementPropertyChangeRepaintFilter(ElementPropertyChangeRepaintFilter filter)
Sets element property change repaint filter.
|
void |
setElementSelectColorGenerator(Generator elementSelectColorGenerator)
Sets a new element selected color generator for this network.
|
void |
setElementStateOutlineColorGenerator(Generator elementOutlineColorGenerator)
Sets a new element state outline color generator for this network.
|
void |
setElementToolTipTextGenerator(Generator elementToolTipTextGenerator)
Sets a new the tooltip text generator for this network.
|
void |
setElementTransparentAreaSelectable(boolean isElementTransparentAreaSelectable)
Sets this value used to determine whether click the
element image transparent area is able to select the element.
|
void |
setEnableAnimation(boolean enableAnimation)
Sets whether to enable animation on this network canvas.
|
void |
setEnableAttachmentDefaultAction(boolean enableAttachmentDefaultAction)
Sets whether the default action on attachment should be enable.
|
void |
setEnableAutoAdjustCanvasSize(boolean enableAutoAdjustCanvasSize)
Determines whether this network canvas needs to to be adjusted automatically
when something that affects the canvas view size happened, such as element's
location changed, element is removed or added, zoom in or zoom out, etc.
|
void |
setEnableAutoScroll(boolean enableAutoScroll)
Sets this value to true to make network canvas viewport
automatically scrolled when element(s) is dragging, false otherwise.
|
void |
setEnableBlinking(boolean enableBlinking)
Sets whether to enable blinking on this network canvas.
|
void |
setEnableCopyPasteWithKeyboard(boolean isEnableCopyPasteWithKeyboard)
Sets whether network enable copy and paste elements with keyboard.
|
void |
setEnableDeleteWithKeyboard(boolean isEnableDeleteWithKeyboard)
Sets whether network enable delete elements with keyboard.
|
void |
setEnableDoubleClickToUp(boolean enableDoubleClickToUp)
If set this value to true, double click on network canvas blank
area will goto upper subnetwork layer, false will do nothing
on double click.
|
void |
setEnableEnterEmptySubNetwork(boolean enableIntoEmptySubNetwork)
By default, all subnetwork can be double clicked to drill down.
|
void |
setEnableExitFullScreenWithKeyboard(boolean isEnableExitFullScreenWithKeyboard)
Sets whether network enable exit full screen with keyboard.
|
void |
setEnableIllegalLinkVisible(boolean enableIllegalLinkVisible)
Sets whether the illegal links are visible.
|
void |
setEnableMouseWheelToZoom(boolean enableMouseWheelToZoom)
Sets whether enable scrolling mouse wheel to zoom in/out.
|
void |
setEnableRightClickEvent(boolean isEnableRightClickEvent) |
void |
setEnableSelectAllWithKeyboard(boolean isEnableSelectAllWithKeyboard)
Sets whether network enable select all with keyboard.
|
void |
setEnableSwitchFullScreenWithKeyboard(boolean isEnableSwitchFullScreenWithKeyboard)
Sets whether network enable switch full screen with keyboard.
|
void |
setEnableUndoRedoWithKeyboard(boolean isEnableUndoRedoWithKeyboard)
Sets whether network enable undo and redo elements with keyboard.
|
void |
setEnsureVisibleOnSelected(boolean isEnsureVisibleOnSelected)
Determines whether or not to ensure the element visible when selected.
|
void |
setExpandGroupAfterLayout(boolean expandGroupAfterLayout)
Sets whether to expand group after doing layout.
|
void |
setFrozeLinkShape(boolean frozeLinkShape) |
void |
setFullScreenAttachment(javax.swing.JComponent attachment,
javax.swing.JComponent container,
java.lang.Object constraints)
Sets full screen network attachment.
|
void |
setGroupChildBoundsGenerator(Generator groupChildBoundsGenerator)
Sets a new group child bounds generator for this network.
|
void |
setImageBackground(java.lang.String imageURL)
Sets a image background with a given image url.
|
void |
setInteractionMode(InteractionMode interactionMode)
Sets network interaction mode.
|
void |
setLayoutGroupRecursively(boolean layoutGroupRecursively) |
void |
setLimitElementInPositiveLocation(boolean limitElementInPositiveLocation)
Sets whether the elements can moved to the positive location such as (-100,-100).
|
void |
setLinkBundleAlternate(boolean isLinkBundleAlternate) |
void |
setLinkBundleCompact(boolean isLinkBundleCompact)
Sets whether bundled links is compact style.
|
void |
setLinkLayout(LinkLayouter linkLayout)
Sets a new link layouter object for this network.
|
void |
setLogicalCenterPoint(java.awt.Point centerPoint)
Sets current network logical center point.
|
void |
setLogicalSelection(java.awt.Rectangle logicalBounds,
boolean isIntersectSelection)
Calls the method to select the elements within the given logical bounds.
|
void |
setMessageContentGenerator(Generator messageContentGenerator)
Sets a new message content generator for this network.
|
void |
setMinLayoutXOffset(int minLayoutXOffset) |
void |
setMinLayoutYOffset(int minLayoutYOffset) |
void |
setMovableFilter(MovableFilter filter)
Remove all all movable filters and
add the specified movable filter.
|
void |
setNetworkBackground(Background background)
Set a new background for the network.
|
void |
setPaintAttachmentFilter(PaintAttachmentFilter paintAttachmentFilter) |
void |
setPaintBackground(boolean paintBackground) |
void |
setPaintSelectionStateFilter(PaintSelectionStateFilter paintSelectionStateFilter)
Sets a new paint selection state filter for this network.
|
void |
setPaintState(int paintState) |
void |
setParallelLinkGap(int parallelLinkGap)
Sets a new parallel link gap.
|
void |
setParallelLinkOffset(int parallelLinkOffset)
Sets a new parallel link offset
|
void |
setPhysicalCenterPoint(java.awt.Point centerPoint)
Sets current network physical center point.
|
void |
setPhysicalSelection(java.awt.Point startPoint,
java.awt.Point endPoint,
boolean isIntersectSelection)
Calls the method to select the elements within the bounds area
between start point and end point.
|
void |
setPopupMenuFactory(PopupMenuFactory popupMenuFactory)
Sets popup menu factory for network.
|
void |
setPopupMenuGenerator(PopupMenuGenerator popupMenuGenerator)
Sets popup menu generator for network canvas.
|
void |
setResizableFilter(ResizableFilter resizableFilter)
Sets resizable filter for this network.
|
void |
setSelectableOnRightClick(boolean isSelectableOnRightClick)
Sets this to true, then right click mouse will select the clicked element;
sets this to false, then right click mouse will not select the clicked element.
|
void |
setSelection(java.util.Collection elements)
Clears all current selection and makes given elements selected.
|
void |
setSelection(Element element)
Clears all selection and makes given element selected.
|
void |
setSelectionMode(int selectionMode)
Sets network selection mode.
|
void |
setSendToTopFilter(SendToTopFilter sendToTopFilter)
Sets send-to-top filter for the network.
|
void |
setShowLinkBundleHandler(boolean showLinkBundleHandler)
If true the link bundle handler should be shown on network canvas, false otherwise.
|
void |
setShowPlainElement(boolean showPlainElement)
Sets whether elements on canvas should be rendered with body color
and state outline color.
|
void |
setStraightLinkGap(int straightLinkGap)
Sets a new straight link gap.
|
void |
setStraightLinkOffset(int straightLinkOffset)
Sets a new straight link offset.
|
void |
setTextureBackground(java.lang.String imageURL)
Sets a texture background with a given image url.
|
void |
setToolbar(javax.swing.JToolBar toolbar)
Sets network toolbar.
|
void |
setToolbarByName(java.lang.String toolbarName)
Sets network toolbar by predefined toolbar name.
|
void |
setViewPoint(java.awt.Point viewPoint)
Sets a new top level topology's view port.
|
void |
setZoomer(Zoomer zoomer)
Sets network zoomer, can not be null.
|
void |
showFullScreen()
Calls this method to display network canvas in full screen mode.
|
void |
startEditingAtElement(Element element)
Starts to edit the label of given element.
|
void |
toggleFullScreen()
Calls this method to switch network mode between full screen and normal mode.
|
void |
updateOverview()
Calls this method to update the Overview view (birdeye component) for this network.
|
void |
updateTViewUI()
Calls this method to make this network canvas adjusted and repainted.
|
void |
upSubNetwork(boolean animate)
Goes to up subnetwork.
|
void |
zoomBack()
Calls this method to return back last zoom environment.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, 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, getPeer, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final int MIX_SELECTION
public static final int INTERSECT_SELECTION
public static final int CONTAIN_SELECTION
public static final int PAINT_STATE_DEFAULT
public static final int PAINT_STATE_OVERVIEW
public static final int PAINT_STATE_EXPORT
public static final int PAINT_STATE_PRINT
public static final int PAINT_STATE_PRINT_PREVIEW
protected Element exportingElement
public java.util.List _A
public TNetwork()
TNetwork
object initialized with a default
data box created inside the initialization.TNetwork(TDataBox)
public TNetwork(TDataBox box)
TNetwork
object initialized with an explicit
data box. The data box could not be null value, which'll cause throw a exception.box
- an explicit data box object.TNetwork()
public int getMinLayoutXOffset()
public void setMinLayoutXOffset(int minLayoutXOffset)
public int getMinLayoutYOffset()
public void setMinLayoutYOffset(int minLayoutYOffset)
public java.awt.Cursor getDefaultCursor()
public void setDefaultCursor(java.awt.Cursor defaultCursor)
public boolean isLayoutGroupRecursively()
public void setLayoutGroupRecursively(boolean layoutGroupRecursively)
public boolean isShowPlainElement()
setShowPlainElement(boolean)
public void setShowPlainElement(boolean showPlainElement)
showPlainElement
- True if elements on canvas should be rendered
body color and state outline color, false otherwise.isShowPlainElement()
,
setElementBodyColorGenerator(Generator)
,
setElementStateOutlineColorGenerator(Generator)
,
TUIManager.setElementBodyColorGenerator(Generator)
,
TUIManager.setElementStateOutlineColorGenerator(Generator)
public Generator getElementStateOutlineColorGenerator()
getElementStateOutlineColorGenerator
in interface twaver.base.obfuscate.view.Network
setElementStateOutlineColorGenerator(Generator)
,
TUIManager.getElementStateOutlineColorGenerator()
public void setElementStateOutlineColorGenerator(Generator elementOutlineColorGenerator)
setElementStateOutlineColorGenerator
in interface twaver.base.obfuscate.view.Network
elementOutlineColorGenerator
- a new element state outline
color generator for this network.getElementSelectColorGenerator()
,
TUIManager.setElementStateOutlineColorGenerator(Generator)
public Generator getElementBodyColorGenerator()
getElementBodyColorGenerator
in interface twaver.base.obfuscate.view.Network
setElementBodyColorGenerator(Generator)
,
TUIManager.getElementBodyColorGenerator()
public void setElementBodyColorGenerator(Generator elementBodyColorGenerator)
setElementBodyColorGenerator
in interface twaver.base.obfuscate.view.Network
elementBodyColorGenerator
- a new element body color generator for this network.getElementBodyColorGenerator()
,
TUIManager.getElementBodyColorGenerator()
public void paintComponent(java.awt.Graphics g, java.awt.Component c, int x, int y, int w, int h)
public void paintComponent(java.awt.Graphics g, java.awt.Component c, java.awt.Rectangle bounds)
public BlinkingRule getBlinkingRule()
setBlinkingRule(BlinkingRule)
,
TUIManager.getBlinkingRule()
,
BlinkingRule
public void setBlinkingRule(BlinkingRule blinkingRule)
blinkingRule
- the new blinking ruler for this network component.getBlinkingRule()
,
TUIManager.setBlinkingRule(BlinkingRule)
,
BlinkingRule
public PaintSelectionStateFilter getPaintSelectionStateFilter()
setPaintSelectionStateFilter(PaintSelectionStateFilter)
public void setPaintSelectionStateFilter(PaintSelectionStateFilter paintSelectionStateFilter)
paintSelectionStateFilter
- a new paint selection state filter for this network.getPaintSelectionStateFilter()
public boolean isSelectedStatePaintable(Element element)
element
- the element to be checked.public boolean isEnableAutoAdjustCanvasSize()
public void setEnableAutoAdjustCanvasSize(boolean enableAutoAdjustCanvasSize)
enableAutoAdjustCanvasSize
- True if if this network canvas needs to to
be adjusted automatically, false otherwise.public boolean isEnableIllegalLinkVisible()
By default, TWaver will hide all illegal links.
isEnableIllegalLinkVisible
in interface twaver.base.obfuscate.view.Network
setEnableIllegalLinkVisible(boolean)
public void setEnableIllegalLinkVisible(boolean enableIllegalLinkVisible)
By default, TWaver will hide all illegal links. Use this method to change the default value.
setEnableIllegalLinkVisible
in interface twaver.base.obfuscate.view.Network
enableIllegalLinkVisible
- True if illegal
links are visible, false otherwise.isEnableIllegalLinkVisible()
public DoubleClickableFilter getDoubleClickableFilter()
setDoubleClickableFilter(DoubleClickableFilter)
,
DoubleClickableFilter
public void setDoubleClickableFilter(DoubleClickableFilter doubleClickableFilter)
doubleClickableFilter
- a new element double clickable filter for the network.getDoubleClickableFilter()
,
DoubleClickableFilter
public boolean isDoubleClickable(Element element)
DoubleClickableFilter
instance
will be used to determine the result value.element
- the element to be checkedgetDoubleClickableFilter()
,
setDoubleClickableFilter(DoubleClickableFilter)
public boolean isEnableDoubleClickToUp()
setEnableDoubleClickToUp(boolean)
public void setEnableDoubleClickToUp(boolean enableDoubleClickToUp)
enableDoubleClickToUp
- true to enable go upper action, false otherwiseisEnableDoubleClickToUp()
public boolean isEnableEnterEmptySubNetwork()
setEnableEnterEmptySubNetwork(boolean)
public void setEnableEnterEmptySubNetwork(boolean enableIntoEmptySubNetwork)
enableIntoEmptySubNetwork
- true to enable to drill down empty
subnetwork, false otherwise.isEnableEnterEmptySubNetwork()
public boolean isEnableAutoScroll()
setEnableAutoScroll(boolean)
public void setEnableAutoScroll(boolean enableAutoScroll)
enableAutoScroll
- True to make network canvas viewport
automatically scrolled when element(s) is dragging, false otherwise.isEnableAutoScroll()
public boolean isShowLinkBundleHandler()
isShowLinkBundleHandler
in interface twaver.base.obfuscate.view.Network
setShowLinkBundleHandler(boolean)
public void setShowLinkBundleHandler(boolean showLinkBundleHandler)
setShowLinkBundleHandler
in interface twaver.base.obfuscate.view.Network
showLinkBundleHandler
- If true the link bundle handler should be shown on
network canvas, false otherwise.isShowLinkBundleHandler()
public float getAlpha()
setAlpha(float)
public void setAlpha(float alpha)
alpha
- this value must between 0.0f and 1.0f.getAlpha()
public void addBackgroundDoubleClickedActionListener(java.awt.event.ActionListener l)
l
- action listener to be addedremoveBackgroundDoubleClickedActionListener(ActionListener)
public void removeBackgroundDoubleClickedActionListener(java.awt.event.ActionListener l)
l
- action listener to be removed.addBackgroundDoubleClickedActionListener(ActionListener)
public void fireBackgroundDoubleClicked(MouseActionEvent event)
event
- the event to be firedpublic void addElementDoubleClickedActionListener(java.awt.event.ActionListener l)
l
- action listener to be addedremoveElementDoubleClickedActionListener(ActionListener)
public void removeElementDoubleClickedActionListener(java.awt.event.ActionListener l)
l
- actin listener to be removedaddElementDoubleClickedActionListener(ActionListener)
public java.util.List getElementDoubleClickedActionListeners()
public java.util.List getElementClickedActionListeners()
public java.util.List getBackgroundDoubleClickedActionListeners()
public void fireElementDoubleClicked(MouseActionEvent event)
event
- the event to be fired.public void addElementClickedActionListener(java.awt.event.ActionListener l)
l
- actin listener to be added.removeElementClickedActionListener(ActionListener)
public void removeElementClickedActionListener(java.awt.event.ActionListener l)
l
- the listener to be removedaddElementClickedActionListener(ActionListener)
public void fireElementClicked(MouseActionEvent event)
event
- the event to be firedpublic int getDragCriticalValue()
setDragCriticalValue(int)
public void setDragCriticalValue(int dragCriticalValue)
Default value of 1. More big, the elements will more "sticky" and hard to drag.
dragCriticalValue
- new critical value for draggetDragCriticalValue()
public boolean isElementTransparentAreaSelectable()
#setElementTransparentAreaSelectable()
public void setElementTransparentAreaSelectable(boolean isElementTransparentAreaSelectable)
isElementTransparentAreaSelectable
- True if click
element transparent area is able to select the element, false otherwiseisElementTransparentAreaSelectable()
public DraggingSpeed getDraggingSpeed()
See DraggingSpeed
for more information.
setDraggingSpeed(DraggingSpeed)
public void setDraggingSpeed(DraggingSpeed draggingSpeed)
See DraggingSpeed
for more information.
draggingSpeed
- dragging speed object.getDraggingSpeed()
public NetworkPrinter getPrinter()
NetworkPrinter
public void paintNetworkContent(java.awt.Graphics g, double xScale, double yScale, boolean considerClipBounds)
g
- Graphics graphics to be paint onxScale
- double x scale valueyScale
- double y scale valueconsiderClipBounds
- boolean true to consider clip bounds, false ignore clip bounds.protected java.lang.String getCanvasToolTipText(java.awt.event.MouseEvent e)
e
- the mouse eventgetElementToolTipTextGenerator()
protected javax.swing.JToolTip createCanvasToolTip()
public void toggleFullScreen()
public void showFullScreen()
exitFullScreen()
public void exitFullScreen()
showFullScreen()
public void setFullScreenAttachment(javax.swing.JComponent attachment, javax.swing.JComponent container, java.lang.Object constraints)
attachment
- the attachment which will be show with canvas when network is full screen.container
- the attachment's parent container that the attachment will be added to
when exit full screen.constraints
- the constraints which is used when attachment is added back to container.public boolean isFullScreen()
showFullScreen()
,
exitFullScreen()
public boolean isVisible(Element element)
isVisible
in interface twaver.base.obfuscate.view.Network
element
- the element to be checked.addVisibleFilter(VisibleFilter)
public boolean isMovable(Element element)
isMovable
in interface twaver.base.obfuscate.view.Network
element
- the element to be checked.public boolean isSelectable(Element element)
isSelectable
in interface twaver.base.obfuscate.view.Network
element
- the element to be checked.public void addCanvasCushion(CanvasCushion canvasCushion)
canvasCushion
- a new canvas cushion on this network.removeCanvasCushion(CanvasCushion)
,
CanvasCushion
public void removeCanvasCushion(CanvasCushion canvasCushion)
canvasCushion
- the canvas cushion to be removed.addCanvasCushion(CanvasCushion)
,
CanvasCushion
public java.util.List getCanvasCushions()
public void addCanvasMarker(CanvasMarker m)
m
- the canvas marker to be added.removeCanvasMarker(CanvasMarker)
public void removeCanvasMarker(CanvasMarker m)
m
- the canvas marker to be removed.addCanvasMarker(CanvasMarker)
public java.util.List getCanvasMarkers()
protected void initDnD()
public java.awt.Dimension getCanvasSize()
public javax.swing.JComponent getCanvas()
public DataBoxSelectionModel getSelectionModel()
TDataBox.getSelectionModel()
public Element getLastSelectedElement()
public java.util.Iterator selection()
TDataBox.selection()
public TDataBox getDataBox()
getDataBox
in interface TView
setDataBox(TDataBox)
public void setDataBox(TDataBox box)
setDataBox
in interface TView
box
- the new databox to be connect to the networkgetDataBox()
public Background getNetworkBackground()
This method is just a simple wrap, internally the background of databox is returned.
getNetworkBackground
in interface twaver.base.obfuscate.view.Network
setNetworkBackground(Background)
,
TDataBox.getBackground()
public void setNetworkBackground(Background background)
This method is just a simple wrap, internally the background is setted to databox.
setNetworkBackground
in interface twaver.base.obfuscate.view.Network
background
- a new background for the network.getNetworkBackground()
,
TDataBox.setBackground(Background)
public void setBackground(Background background)
background
- Background the new background objectgetNetworkBackground()
public void setTextureBackground(java.lang.String imageURL)
imageURL
- the given image urlsetBackground(Background)
,
TextureBackground
public void setImageBackground(java.lang.String imageURL)
imageURL
- the given image urlsetBackground(Background)
,
ImageBackground
public void setColorBackground(java.awt.Color color)
color
- the given colorsetBackground(Background)
,
ColorBackground
public boolean isApplyBackgroundThroughSubNetwork()
isApplyBackgroundThroughSubNetwork
in interface twaver.base.obfuscate.view.Network
setApplyBackgroundThroughSubNetwork(boolean)
public void setApplyBackgroundThroughSubNetwork(boolean applyBackgroundThroughSubNetwork)
setApplyBackgroundThroughSubNetwork
in interface twaver.base.obfuscate.view.Network
applyBackgroundThroughSubNetwork
- If true this network's background
is applied to all subnetworks that have no assigned background, false otherwise.isApplyBackgroundThroughSubNetwork()
public Background getCurrentBackground()
getCurrentBackground
in interface twaver.base.obfuscate.view.Network
setCurrentBackground(Background)
,
getNetworkBackground()
,
TSubNetwork.getBackground()
public void setCurrentBackground(Background background)
setCurrentBackground
in interface twaver.base.obfuscate.view.Network
getCurrentBackground()
,
TSubNetwork.setBackground(Background)
public java.awt.Point getLogicalCenterPoint()
setLogicalCenterPoint(Point)
public void setLogicalCenterPoint(java.awt.Point centerPoint)
centerPoint
- a new center pointgetLogicalCenterPoint()
public void setPhysicalCenterPoint(java.awt.Point centerPoint)
centerPoint
- a new center pointpublic java.awt.Point getPhysicalCenterPoint()
public java.awt.Dimension getLogicalSize()
public boolean adjustCanvasSize()
Note that if isEnableAutoAdjustCanvasSize is false, then this method will do nothing.
forceAdjustCanvasSize()
public boolean forceAdjustCanvasSize()
Note that this method will not consider isEnableAutoAdjustCanvasSize value.
forceAdjustCanvasSize()
public boolean adjustCanvasSize(Element element)
adjustCanvasSize()
instead.
Internal use only.element
- the element to be adjusted.public boolean adjustCanvasSize(java.awt.Point point)
point
- the point to be adjusted.public boolean adjustCanvasSize(int maxX, int maxY)
maxX
- the max x valuemaxY
- the max y valuepublic void panCanvas(int xOffset, int yOffset)
xOffset
- the x coordinate offset.yOffset
- the y coordinate offset.public void ensureVisible(Element element)
element
- the element to be visiblepublic void ensureVisible(java.awt.Rectangle bounds)
bounds
- a rectangle to be visiblepublic NetworkElementRenderer getRenderer()
public java.awt.Rectangle getElementBounds(Element element)
renderer.getBounds(Graphics,Element)
.
Using this method instead of renderer.getBounds method can enhance
the performance.element
- the given element object.public Generator getGroupChildBoundsGenerator()
setGroupChildBoundsGenerator(Generator)
public void setGroupChildBoundsGenerator(Generator groupChildBoundsGenerator)
groupChildBoundsGenerator
- a new group child bounds
generator for this network.getGroupChildBoundsGenerator()
public void invalidateElementBounds(Element element)
element
- the element its bounds needs to be invalidatepublic java.util.Map getElementBoundsCache()
public void invalidateAllElementBounds()
public java.util.List getElementsAt(java.awt.Rectangle rect, boolean isIntersectSelection)
rect
- the conditional rectangleisIntersectSelection
- True if select all intersected elements,
false select all contained elements.public Element getElementLogicalAt(java.awt.geom.Point2D p)
p
- a logical locationpublic Element getElementLogicalAt(int x, int y)
x
- logical x valuey
- logical y valuepublic java.util.List getElementsLogicalAt(java.awt.Point p, boolean selectable)
p
- the given logical point.public java.util.List getElementsLogicalAt(java.awt.Point p)
public java.util.List getElementsLogicalAt(int x, int y, boolean selectable)
x
- logical x valuey
- logical y valuepublic java.util.List getElementsLogicalAt(int x, int y)
public Element getSelectedElementLogicalAt(int x, int y)
x
- the x coordinate x logical valuey
- the y coordinate. y logical valuepublic Element getSelectedElementPhysicalAt(java.awt.Point p)
p
- the given locationpublic Element getSelectedElementPhysicalAt(int x, int y)
x
- x location valuey
- y location valuepublic Element getElementPhysicalAt(java.awt.Point p)
p
- the given physical locationpublic Element getElementPhysicalAt(int x, int y)
x
- x locationy
- y locationpublic java.util.List getElementsPhysicalAt(java.awt.Point p)
p
- given physical pointpublic java.util.List getElementsPhysicalAt(int x, int y)
x
- x locationy
- y locationpublic void setSelection(Element element)
element
- the element to be selectedpublic void appendSelection(Element element)
element
- the element to be selectedpublic void removeSelection(Element element)
element
- the element to be removed from selection modelpublic void setSelection(java.util.Collection elements)
elements
- the elements to be selectedpublic void clearSelection()
public void selectAll()
public PopupMenuFactory getPopupMenuFactory()
PopupMenuFactory
for more information.public void setPopupMenuFactory(PopupMenuFactory popupMenuFactory)
PopupMenuFactory
for more information.popupMenuFactory
- the new popup menu factory for networkpublic void exportImage(java.lang.String fileName)
fileName
- String the image file name to be generate.
The generated file format if JPG.public boolean exportImage(java.lang.String fileName, java.lang.String formatName)
fileName
- the image file to be generated.formatName
- the image format type, it can be
png,jpg,gif,bmp,etc. Please note some format may not be
supported by some version of JDK.public boolean exportImage(java.lang.String fileName, java.lang.String formatName, double zoom)
fileName
- the image file to be generated.formatName
- the image format type, it can be
png,jpg,gif,bmp,etc. Please note some format may not bezoom
- the zoom factorypublic boolean exportToImageIcon(java.lang.String iconUrl, java.lang.String formatName, double zoom)
public boolean exportImageCoverElements(java.lang.String fileName, java.lang.String formatName, int margin)
fileName
- the image file to be generated.formatName
- the image format type, it can be
png,jpg,gif,bmp,etc. Please note some format may not bemargin
- the margin of cover areapublic boolean exportImageCoverElements(java.lang.String fileName, java.lang.String formatName, int margin, double zoom)
fileName
- the image file to be generated.formatName
- the image format type, it can be
png,jpg,gif,bmp,etc. Please note some format may not bemargin
- the margin of cover areazoom
- the zoom factorpublic boolean exportCoverElementsToImageIcon(java.lang.String iconUrl, java.lang.String formatName, int margin, double zoom)
public boolean exportElementToFile(Element element, java.lang.String fileName, java.lang.String formatName, int margin, double zoom)
public boolean exportElementsToFile(Generator fileNameGenerator, java.lang.String formatName, int margin, double zoom)
public boolean exportElementToImageIcon(Element element, java.lang.String iconUrl, java.lang.String formatName, int margin, double zoom)
public boolean exportElementsToImageIcon(Generator iconUrlGenerator, java.lang.String formatName, int margin, double zoom)
public boolean exportImage(java.io.OutputStream outputStream, java.lang.String formatName, java.awt.Rectangle logicalBounds, double zoom)
outputStream
- the given output stream for outputformatName
- the image format type, it can be png,jpg,gif,bmp,etc.
Please note some format may not belogicalBounds
- the logical bounds to be outputzoom
- the zoom factorpublic boolean exportImage(java.lang.String fileName, java.lang.String formatName, java.awt.Rectangle logicalBounds, double zoom)
fileName
- the image file to be generated.formatName
- the image format type, it can be png,jpg,gif,bmp,etc.
Please note some format may not belogicalBounds
- the logical bounds to be outputzoom
- the zoom factorpublic boolean exportToImageIcon(java.lang.String iconUrl, java.lang.String formatName, java.awt.Rectangle logicalBounds, double zoom)
public void addElementToCurrentSubNetwork(Element element)
Also this method will fire a InteractionEvent.ELEMENT_CREATED event.
element
- the new element to be added.public void pasteElements()
this method will fire InteractionEvent.ELEMENT_CREATED event.
TDataBox.pasteElements(Element)
public void loadAndEnterSubNetwork(TSubNetwork subNetwork)
subNetwork
- the given subnetwork to be loaded.TDataBox.loadSubNetwork(TSubNetwork)
public void upSubNetwork(boolean animate)
public TSubNetwork getCurrentSubNetwork()
getCurrentSubNetwork
in interface twaver.base.obfuscate.view.Network
setCurrentSubNetwork(TSubNetwork)
public void setCurrentSubNetwork(TSubNetwork subNetwork)
The subnetwork element must contained in the box. Otherwise, exception will thrown.
setCurrentSubNetwork
in interface twaver.base.obfuscate.view.Network
subNetwork
- the new subnetwork element.getCurrentSubNetwork()
public InteractionMode getInteractionMode()
setInteractionMode(InteractionMode)
public void setInteractionMode(InteractionMode interactionMode)
interactionMode
- the new interaction mode.getInteractionMode()
public javax.swing.JScrollPane getCanvasScrollPane()
public void setEnsureVisibleOnSelected(boolean isEnsureVisibleOnSelected)
isEnsureVisibleOnSelected
- True if element need to ensure
visible on selected, false otherwise.isEnsureVisibleOnSelected()
public boolean isEnsureVisibleOnSelected()
setEnsureVisibleOnSelected(boolean)
public Zoomer getZoomer()
setZoomer(Zoomer)
public void setZoomer(Zoomer zoomer)
zoomer
- the new zoomer object for network canvasgetZoomer()
public double getZoom()
public void zoomBack()
public void saveCurrentBrowserRecord()
public javax.swing.ButtonGroup getDefaultButtonGroup()
getToolbar()
public javax.swing.JToolBar getToolbar()
setToolbar(JToolBar)
public void setToolbar(javax.swing.JToolBar toolbar)
toolbar
- new network toolbargetToolbar()
public javax.swing.AbstractButton getToolbarButtonByName(java.lang.String buttonName)
buttonName
- the querying button's name.public void setToolbarByName(java.lang.String toolbarName)
NetworkToolBarFactory
.
See NetworkToolBarFactory.getToolBar(java.lang.String, twaver.Generator)
for more
informationtoolbarName
- String toolbar name to be used.public void addVisibleFilter(VisibleFilter filter)
addVisibleFilter
in interface twaver.base.obfuscate.view.Network
filter
- a new visible filter to be addedremoveVisibleFilter(VisibleFilter)
,
VisibleFilter
public java.util.List getVisibleFilters()
getVisibleFilters
in interface twaver.base.obfuscate.view.Network
public void removeVisibleFilter(VisibleFilter filter)
removeVisibleFilter
in interface twaver.base.obfuscate.view.Network
filter
- a visible filter to be removedaddVisibleFilter(VisibleFilter)
,
VisibleFilter
public void setMovableFilter(MovableFilter filter)
filter
- the movable filter to be setted.public void addSelectableFilter(SelectableFilter filter)
addSelectableFilter
in interface twaver.base.obfuscate.view.Network
filter
- a new selectable filter to be added.removeSelectableFilter(SelectableFilter)
public void removeSelectableFilter(SelectableFilter filter)
removeSelectableFilter
in interface twaver.base.obfuscate.view.Network
filter
- a selectable filter to be removed.addSelectableFilter(SelectableFilter)
public java.util.List getSelectableFilters()
getSelectableFilters
in interface twaver.base.obfuscate.view.Network
public void addMovableFilter(MovableFilter filter)
addMovableFilter
in interface twaver.base.obfuscate.view.Network
filter
- a new movable filter to be added.removeMovableFilter(MovableFilter)
,
clearMovableFilters()
public void removeMovableFilter(MovableFilter filter)
removeMovableFilter
in interface twaver.base.obfuscate.view.Network
filter
- a movable filter to be removed.addMovableFilter(MovableFilter)
public void clearMovableFilters()
clearMovableFilters
in interface twaver.base.obfuscate.view.Network
addMovableFilter(MovableFilter)
,
removeMovableFilter(MovableFilter)
public java.util.List getMovableFilters()
getMovableFilters
in interface twaver.base.obfuscate.view.Network
public java.awt.Point getLogicalPoint(java.awt.Point physicalPoint)
physicalPoint
- a physical pointpublic java.awt.Point getPhysicalPoint(java.awt.Point logicalPoint)
logicalPoint
- a logical pointpublic java.awt.Rectangle getLogicalBounds(java.awt.Rectangle physicalRect)
physicalRect
- a physical rectangle.public java.awt.Rectangle getPhysicalBounds(java.awt.Rectangle logicalRect)
logicalRect
- a logical rectangle.public LinkLayouter getLinkLayouter()
setLinkLayout(LinkLayouter)
public void setLinkLayout(LinkLayouter linkLayout)
linkLayout
- the new link layouter object for this network.getLinkLayouter()
public void dispose()
After disposed, this network component can not be used anymore.
public void updateTViewUI()
updateTViewUI
in interface TView
public void setElementLabelGenerator(Generator elementLabelGenerator)
LabelAttachment
of element on network canvas.setElementLabelGenerator
in interface twaver.base.obfuscate.view.Network
elementLabelGenerator
- a new label generator for this network.getElementLabelGenerator()
,
TUIManager.setElementNetworkLabelGenerator(Generator)
public Generator getElementLabelGenerator()
LabelAttachment
of element on network canvas.getElementLabelGenerator
in interface twaver.base.obfuscate.view.Network
setElementLabelGenerator(Generator)
,
TUIManager.getElementNetworkLabelGenerator()
public Magnifier getMagnifier()
public boolean isEnableMouseWheelToZoom()
setEnableMouseWheelToZoom(boolean)
public void setEnableMouseWheelToZoom(boolean enableMouseWheelToZoom)
enableMouseWheelToZoom
- true if enable, false disable.isEnableMouseWheelToZoom()
public javax.swing.JLayeredPane getLayeredPane()
public void adjustComponentPosition(javax.swing.JComponent component)
component
- the given component to be adjusted.public ResizableFilter getResizableFilter()
getResizableFilter
in interface twaver.base.obfuscate.view.Network
setResizableFilter(ResizableFilter)
public void setResizableFilter(ResizableFilter resizableFilter)
setResizableFilter
in interface twaver.base.obfuscate.view.Network
resizableFilter
- the new resizable filtergetResizableFilter()
public boolean isResizable(Element element)
isResizable
in interface twaver.base.obfuscate.view.Network
element
- the element to be checked.public void setLimitElementInPositiveLocation(boolean limitElementInPositiveLocation)
limitElementInPositiveLocation
- true if allow, false notisLimitElementInPositiveLocation()
public boolean isLimitElementInPositiveLocation()
setLimitElementInPositiveLocation(boolean)
public void centerElement(Element element)
element
- the element to be centered to the viewpublic ElementBoundsInvalidatableFilter getElementBoundsInvalidatableFilter()
setElementBoundsInvalidatableFilter(ElementBoundsInvalidatableFilter)
public void setElementBoundsInvalidatableFilter(ElementBoundsInvalidatableFilter filter)
filter
- the new element bounds invalidatable filtergetElementBoundsInvalidatableFilter()
public ElementPropertyChangeRepaintFilter getElementPropertyChangeRepaintFilter()
See ElementPropertyChangeRepaintFilter
for more information.
setElementPropertyChangeRepaintFilter(ElementPropertyChangeRepaintFilter)
public void setElementPropertyChangeRepaintFilter(ElementPropertyChangeRepaintFilter filter)
See ElementPropertyChangeRepaintFilter
for more information.
filter
- the filter to be installedgetElementPropertyChangeRepaintFilter()
public void addCanvasPaintListener(CanvasPaintListener l)
l
- a canvas paint listener to be added.public void removeCanvasPaintListener(CanvasPaintListener l)
l
- a canvas paint listener to be removed.public java.util.List getCanvasPaintListeners()
public void addInteractionListener(InteractionListener listener)
listener
- the listener to be addedremoveInteractionListener(twaver.network.InteractionListener)
public void removeInteractionListener(InteractionListener listener)
listener
- the listener to be removedaddInteractionListener(InteractionListener)
public void fireInteractionPerformed(java.lang.Object source, int type, java.awt.event.MouseEvent mouseEvent)
source
- the source of the event.type
- the type of the event.mouseEvent
- the mouse event.InteractionEvent
public void fireInteractionPerformed(java.lang.Object source, int type, int index, java.awt.event.MouseEvent mouseEvent)
source
- the source of the event.type
- the type of the event.index
- the index param.mouseEvent
- the mouse event.InteractionEvent
public void fireInteractionPerformed(InteractionEvent event)
event
- InteractionEvent the event to be fired.public ElementUI getElementUI(Element element)
element
- the given elementpublic void saveCurrentSubNetwork(java.lang.String fileName) throws java.io.IOException
fileName
- the filename to be savedjava.io.IOException
- throw if any I/O exception occurpublic void saveCurrentSubNetwork(java.lang.String fileName, boolean withElementID, boolean withAlarmState) throws java.io.IOException
fileName
- xml file namewithElementID
- whether save element idwithAlarmState
- whether save alarm state informationjava.io.IOException
- throw if any I/O exception occurpublic EditableFilter getElementLabelEditableFilter()
setElementLabelEditableFilter(EditableFilter)
public LabelInputField getElementLabelInputField()
public void setElementLabelEditableFilter(EditableFilter elementLabelEditableFilter)
elementLabelEditableFilter
- a new element label editable filtergetElementLabelEditableFilter()
public ElementLabelEditor getElementLabelEditor()
setElementLabelEditor(ElementLabelEditor)
public void setElementLabelEditor(ElementLabelEditor elementLabelEditor)
elementLabelEditor
- a new element label editorgetElementLabelEditor()
public void startEditingAtElement(Element element)
element
- the element to be editgetElementLabelEditor()
public ElementUI createElementUI(Element element)
element
- an element needs to create ui instancepublic void updateOverview()
public SendToTopFilter getSendToTopFilter()
SendToTopFilter
for more information.setSendToTopFilter(SendToTopFilter)
public void setSendToTopFilter(SendToTopFilter sendToTopFilter)
SendToTopFilter
for more information.sendToTopFilter
- a new send-to-top filter to be used.getSendToTopFilter()
public Generator getElementToolTipTextGenerator()
getElementToolTipTextGenerator
in interface twaver.base.obfuscate.view.Network
setElementToolTipTextGenerator(Generator)
,
TUIManager.getElementToolTipTextGenerator()
public void setElementToolTipTextGenerator(Generator elementToolTipTextGenerator)
setElementToolTipTextGenerator
in interface twaver.base.obfuscate.view.Network
elementToolTipTextGenerator
- a new the tooltip text generator for this network.getElementToolTipTextGenerator()
,
TUIManager.setElementToolTipTextGenerator(Generator)
public boolean isSelectableOnRightClick()
setSelectableOnRightClick(boolean)
public void setSelectableOnRightClick(boolean isSelectableOnRightClick)
isSelectableOnRightClick
- true enable select when right click, false otherwiseisSelectableOnRightClick()
public boolean isClearSelectionOnMarginClicked()
setClearSelectionOnMarginClicked(boolean)
public void setClearSelectionOnMarginClicked(boolean isClearSelectionOnMarginClicked)
isClearSelectionOnMarginClicked
- true if click blank area on
network will clear all current seleciton; false if click blank area on
network will not clear current selection.isClearSelectionOnMarginClicked()
public int getSelectionMode()
setSelectionMode(int)
public void setSelectionMode(int selectionMode)
selectionMode
- the new network selection modegetSelectionMode()
public boolean isEnableSelectAllWithKeyboard()
public void setEnableSelectAllWithKeyboard(boolean isEnableSelectAllWithKeyboard)
isEnableSelectAllWithKeyboard
- True if network enable select all with keyboard.public boolean isEnableCopyPasteWithKeyboard()
public void setEnableCopyPasteWithKeyboard(boolean isEnableCopyPasteWithKeyboard)
isEnableCopyPasteWithKeyboard
- True if network enable copy and paste elements with keyboard.public boolean isEnableDeleteWithKeyboard()
public void setEnableDeleteWithKeyboard(boolean isEnableDeleteWithKeyboard)
isEnableDeleteWithKeyboard
- True if network enable delete elements with keyboard.public boolean isEnableSwitchFullScreenWithKeyboard()
public void setEnableSwitchFullScreenWithKeyboard(boolean isEnableSwitchFullScreenWithKeyboard)
isEnableSwitchFullScreenWithKeyboard
- True if network enable switch full screen with keyboard.public boolean isEnableExitFullScreenWithKeyboard()
public void setEnableExitFullScreenWithKeyboard(boolean isEnableExitFullScreenWithKeyboard)
isEnableExitFullScreenWithKeyboard
- True if network enable exit full screen with keyboard.public boolean isEnableUndoRedoWithKeyboard()
public void setEnableUndoRedoWithKeyboard(boolean isEnableUndoRedoWithKeyboard)
isEnableUndoRedoWithKeyboard
- True if network enable undo and redo elements with keyboard.public Generator getElementSelectColorGenerator()
getElementSelectColorGenerator
in interface twaver.base.obfuscate.view.Network
setElementSelectColorGenerator(Generator)
public void setElementSelectColorGenerator(Generator elementSelectColorGenerator)
setElementSelectColorGenerator
in interface twaver.base.obfuscate.view.Network
elementSelectColorGenerator
- a new element selected color for this network.getElementSelectColorGenerator()
public java.awt.Color getElementSelectColor(Element element)
element
- element need to checkpublic java.util.ListIterator getPaintElementIterator()
public void layoutToOverview()
public void layoutToOverview(boolean considerZoom)
considerZoom
- If true consider zoom factor, false otherwise.public void layoutToOverview(boolean considerZoom, boolean animate)
considerZoom
- If true consider zoom factor, false otherwise.animate
- If true move element animately.public void layoutToOverview(boolean considerZoom, boolean animate, boolean distort)
considerZoom
- If true consider zoom factor, false otherwise.animate
- If true move element animately.distort
- If true enable distort layoutpublic void layoutToOverview(boolean considerZoom, boolean animate, boolean distort, double xscale, double yscale)
considerZoom
- If true consider zoom factor, false otherwise.animate
- If true move element animately.distort
- If true enable distort layoutxscale
- horizontal scaleyscale
- vertical scalepublic boolean doLayout(int type)
type
- the type of layout effect, Legal values are:
public boolean doLayout(int type, boolean animated)
type
- the type of layout effect, Legal values are:
animated
- whether to do layout animatedpublic boolean doLayout(int type, boolean animated, java.lang.Runnable runnable)
type
- the type of layout effect, Legal values are:
animated
- whether to do layout animatedrunnable
- the runnable will be called after layouted.public boolean doLayout(int type, boolean animated, java.lang.Runnable runnable, Generator elementSizeGenerator)
type
- the type of layout effect, Legal values are:
animated
- whether to do layout animatedrunnable
- the runnable will be called after layouted.elementSizeGenerator
- the element size generator is used to generate
the element size that will be counted when doing layout.public boolean doLayout(java.util.Iterator elements, int type, boolean animated, java.lang.Runnable runnable, int xOffset, int yOffset, Generator elementSizeGenerator)
elements
- the given elements need to be layoutedtype
- the type of layout effect, Legal values are:
animated
- whether to do layout animatedrunnable
- the runnable will be called after layouted.xOffset
- the x offsetyOffset
- the y offsetelementSizeGenerator
- the element size generator is used to generate
the element size that will be counted when doing layout.public void repaint(Element element)
element
- the given element that need to be repainted.public PopupMenuGenerator getPopupMenuGenerator()
PopupMenuGenerator
for more information.public void setPopupMenuGenerator(PopupMenuGenerator popupMenuGenerator)
PopupMenuGenerator
for more information.popupMenuGenerator
- the popup menu generator
to be used for this network canvaspublic boolean isAlarmBalloonVisible()
public void setAlarmBalloonVisible(boolean alarmBalloonVisible)
alarmBalloonVisible
- True if the alarm balloon attachment is
visible on network canvas.public SpringLayouter getSpringLayouter()
SpringLayouter
public Generator getAlarmLabelGenerator()
setAlarmLabelGenerator(Generator)
public void setAlarmLabelGenerator(Generator alarmLabelGenerator)
alarmLabelGenerator
- getAlarmLabelGenerator()
public Generator getMessageContentGenerator()
setMessageContentGenerator(Generator)
public void setMessageContentGenerator(Generator messageContentGenerator)
messageContentGenerator
- a new message content generator for this network.getMessageContentGenerator()
public void moveSelectedElements(double xOffset, double yOffset)
xOffset
- the offset of x coordinateyOffset
- the offset of y coordinatepublic void moveSelectedElements(double xOffset, double yOffset, java.lang.Runnable runnable, int stepSize, int sleep)
xOffset
- the offset of x coordinateyOffset
- the offset of y coordinatepublic void setLogicalSelection(java.awt.Rectangle logicalBounds, boolean isIntersectSelection)
logicalBounds
- the given logical boundsisIntersectSelection
- True if select all intersected elements,
false select all contained elements.public void setPhysicalSelection(java.awt.Point startPoint, java.awt.Point endPoint, boolean isIntersectSelection)
startPoint
- the start physical pointendPoint
- the end physical pointisIntersectSelection
- True if select all intersected elements,
false select all contained elements.public java.awt.Point getViewPoint()
public void setViewPoint(java.awt.Point viewPoint)
viewPoint
- a new top level topology's view port.public void exportSVG(java.lang.String fileName)
fileName
- the SVG file to be exported.public boolean isEnableAnimation()
setEnableAnimation(boolean)
public void setEnableAnimation(boolean enableAnimation)
enableAnimation
- True if enable animation on this
network canvas, false otherwise.public boolean isEnableBlinking()
public void setEnableBlinking(boolean enableBlinking)
public Overview getDefaultOverview()
public Generator getAlarmColorGenerator()
public void setAlarmColorGenerator(Generator alarmColorGenerator)
alarmColorGenerator
- a new alarm color generator.public boolean isExpandGroupAfterLayout()
public void setExpandGroupAfterLayout(boolean expandGroupAfterLayout)
expandGroupAfterLayout
- True if expand group after doing layout, false otherwise.public boolean isConsiderAttachmentOnLayout()
public void setConsiderAttachmentOnLayout(boolean considerAttachmentOnLayout)
considerAttachmentOnLayout
- True if consider attachment
size when doing auto layout, false otherwise.public boolean isEnableAttachmentDefaultAction()
public void setEnableAttachmentDefaultAction(boolean enableAttachmentDefaultAction)
enableAttachmentDefaultAction
- True if the default action on
attachment should be enable, false otherwise.public boolean exportDividedImages(java.lang.String fileName, java.lang.String format, int rowCount, int columnCount, double zoom)
fileName
- the export file name.format
- the image format.rowCount
- the row count.columnCount
- the column count.zoom
- the zoom factor.public boolean isLinkBundleCompact()
isLinkBundleCompact
in interface twaver.base.obfuscate.view.Network
public void setLinkBundleCompact(boolean isLinkBundleCompact)
setLinkBundleCompact
in interface twaver.base.obfuscate.view.Network
isLinkBundleCompact
- True if bundled links is compact style, false otherwise.public void setStraightLinkGap(int straightLinkGap)
setStraightLinkGap
in interface twaver.base.obfuscate.view.Network
straightLinkGap
- the new straight link gap.public int getStraightLinkGap()
getStraightLinkGap
in interface twaver.base.obfuscate.view.Network
public void setStraightLinkOffset(int straightLinkOffset)
setStraightLinkOffset
in interface twaver.base.obfuscate.view.Network
straightLinkOffset
- the new straight link offset.public int getStraightLinkOffset()
getStraightLinkOffset
in interface twaver.base.obfuscate.view.Network
public void setParallelLinkGap(int parallelLinkGap)
setParallelLinkGap
in interface twaver.base.obfuscate.view.Network
parallelLinkGap
- the new parallel link gap.public int getParallelLinkGap()
getParallelLinkGap
in interface twaver.base.obfuscate.view.Network
public void setParallelLinkOffset(int parallelLinkOffset)
setParallelLinkOffset
in interface twaver.base.obfuscate.view.Network
parallelLinkOffset
- the new parallel link offsetpublic int getParallelLinkOffset()
getParallelLinkOffset
in interface twaver.base.obfuscate.view.Network
public void animateCurrentSubNetwork(TSubNetwork subNetwork)
subNetwork
- the new current subnetworkpublic void animateCurrentSubNetwork(TSubNetwork subNetwork, java.lang.Runnable runnable, int step, int sleep)
subNetwork
- the new current subnetworkrunnable
- the runnable will be run after entering new subnetwork finally.step
- the animate step sizesleep
- the animate sleep intervalpublic boolean isAnimateSubnetworkEnter()
public void setAnimateSubnetworkEnter(boolean animateSubnetworkEnter)
animateSubnetworkEnter
- public boolean isAnimateElementMove()
public void setAnimateElementMove(boolean animateElementMove)
animateElementMove
- public boolean isAnimateElementDelete()
public void setAnimateElementDelete(boolean animateElementDelete)
animateElementDelete
- public boolean isAnimateElementResize()
public void setAnimateElementResize(boolean animateElementResize)
animateElementResize
- public boolean isAnimateComponentAttachment()
public void setAnimateComponentAttachment(boolean animateComponentAttachment)
animateComponentAttachment
- public void handleDrop(java.awt.dnd.DropTargetDropEvent e, java.lang.String className)
protected void dropComplete(java.awt.dnd.DropTargetDropEvent e, Element element)
public boolean isLinkBundleAlternate()
isLinkBundleAlternate
in interface twaver.base.obfuscate.view.Network
public void setLinkBundleAlternate(boolean isLinkBundleAlternate)
setLinkBundleAlternate
in interface twaver.base.obfuscate.view.Network
public void invalidateAllLinkShape()
public PaintAttachmentFilter getPaintAttachmentFilter()
public void setPaintAttachmentFilter(PaintAttachmentFilter paintAttachmentFilter)
public boolean isPaintable(Attachment attachment)
public boolean isFrozeLinkShape()
public void setFrozeLinkShape(boolean frozeLinkShape)
protected void handleElementPropertyChange(java.beans.PropertyChangeEvent e)
public boolean isPaintBackground()
public void setPaintBackground(boolean paintBackground)
public int getPaintState()
public void setPaintState(int paintState)
public boolean isEnableRightClickEvent()
public void setEnableRightClickEvent(boolean isEnableRightClickEvent)
public InteractionMode getCreateLinkMode(java.lang.Class linkType)
public void addComponentOnCanvas(javax.swing.JComponent component, int anchor)
anchor
- : This field is used when the component is smaller than its display
area. It determines where, within the display area, to place the
component.
There are two kinds of possible values: relative and
absolute. Relative values are interpreted relative to the container's
component orientation property while absolute values are not. The absolute
values are:
java.awt.GridBagConstraints
#
CENTER
, NORTH
, NORTHEAST
,
EAST
, SOUTHEAST
, SOUTH
,
SOUTHWEST
, WEST
, and NORTHWEST
.
The relative values are: PAGE_START
, PAGE_END
,
LINE_START
, LINE_END
,
FIRST_LINE_START
, FIRST_LINE_END
,
LAST_LINE_START
and LAST_LINE_END
.
The default value is CENTER
.
Object.clone()
,
ComponentOrientation
Copyright © 2002 - 2010 Serva Software. All Rights Reserved.