public abstract class AbstractBlockWorkspace extends AbstractDesignableWorkspace
This workspace is a specialization of AbstractDesignableWorkspace for workspaces that want to use a block-and-connector style of design.
The user is able to arrange the blocks and draw connections between them, but the path of the connections is
automatically derived. To use this workspace, you'll want to call open(BlockDiagramModel)
with your own
implementation of a BlockDiagramModel
.
Sub-classes may override various functions in order to alter or augment functionality:
newConnectionPainter(BlockDiagramModel)
Override this to create a ConnectionPainter
to control
the visual style of the connections.newEdgeRouter(BlockDiagramModel)
Override this to provide your own EdgeRouter
, used to create
the connection path between any two blocks.Modifier and Type | Class and Description |
---|---|
protected class |
AbstractBlockWorkspace.ConnectionTool
This extension of the standard SelectionTool is AnchorPoint aware and is used for creating connections between
blocks in addition to selecting and moving blocks around
|
com.jidesoft.swing.JideTabbedPane.ColorProvider, com.jidesoft.swing.JideTabbedPane.GradientColorProvider, com.jidesoft.swing.JideTabbedPane.IgnoreableSingleSelectionModel, com.jidesoft.swing.JideTabbedPane.NoFocusButton, com.jidesoft.swing.JideTabbedPane.PageLastFocusTracker, com.jidesoft.swing.JideTabbedPane.TabListCellRenderer
javax.swing.JTabbedPane.AccessibleJTabbedPane, javax.swing.JTabbedPane.ModelListener
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected BasicGridSettings |
gridSettings |
currentTool, defaultScope, DESIGNABLE_CONTAINER_ICON_KEY, DESIGNTIME_PROPNAME, listeners, log, openContainers, selectedItems, selectionControl, selectionTool
_focusChangeListener, _tabEditingAllowed, _tabEditValidator, BOLDACTIVETAB_PROPERTY, BOX_STYLE_PROPERTY, BUTTON_CLOSE, BUTTON_EAST, BUTTON_LIST, BUTTON_NORTH, BUTTON_SOUTH, BUTTON_WEST, COLOR_THEME_DEFAULT, COLOR_THEME_OFFICE2003, COLOR_THEME_VSNET, COLOR_THEME_WIN2K, COLOR_THEME_WINXP, GRIPPER_PROPERTY, HIDE_IF_ONE_TAB_PROPERTY, ONENOTE_COLOR_PROVIDER, PROPERTY_COLOR_THEME, PROPERTY_CONTENT_BORDER_INSETS, PROPERTY_DRAG_OVER_DISABLED, PROPERTY_SELECTED_INDEX, PROPERTY_SHOW_CLOSE_BUTTON_ON_MOUSE_OVER, PROPERTY_TAB_AREA_INSETS, PROPERTY_TAB_COLOR_PROVIDER, PROPERTY_TAB_INSETS, PROPERTY_TAB_LEADING_COMPONENT, PROPERTY_TAB_RESIZE_MODE, PROPERTY_TAB_SHAPE, PROPERTY_TAB_TRAILING_COMPONENT, RESIZE_MODE_COMPRESSED, RESIZE_MODE_DEFAULT, RESIZE_MODE_FIT, RESIZE_MODE_FIXED, RESIZE_MODE_NONE, SCROLL_TAB_ON_WHEEL_PROPERTY, SHAPE_BOX, SHAPE_DEFAULT, SHAPE_ECLIPSE, SHAPE_ECLIPSE3X, SHAPE_EXCEL, SHAPE_FLAT, SHAPE_OFFICE2003, SHAPE_ROUNDED_FLAT, SHAPE_ROUNDED_VSNET, SHAPE_VSNET, SHAPE_WINDOWS, SHAPE_WINDOWS_SELECTED, SHOW_CLOSE_BUTTON_ON_TAB_PROPERTY, SHOW_CLOSE_BUTTON_PROPERTY, SHOW_ICONS_PROPERTY, SHOW_TAB_AREA_PROPERTY, SHOW_TAB_BUTTONS_PROPERTY, SHOW_TAB_CONTENT_PROPERTY, SHRINK_TAB_PROPERTY, TAB_CLOSABLE_PROPERTY, USE_DEFAULT_SHOW_CLOSE_BUTTON_ON_TAB_PROPERTY, USE_DEFAULT_SHOW_ICONS_PROPERTY
changeEvent, changeListener, model, SCROLL_TAB_LAYOUT, tabPlacement, WRAP_TAB_LAYOUT
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Modifier | Constructor and Description |
---|---|
protected |
AbstractBlockWorkspace(ProjectScope scope) |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.String |
copyBlocks(java.util.Collection<Block> blocks)
Copy these blocks to a serialized representation which is understood by
pasteBlocks(String) |
javax.swing.JPopupMenu |
createConnectorEndMenu(BlockDiagramModel model,
AnchorPoint startAnchor,
java.awt.Point end)
Implement this if you want to present the user with a menu of options when they drop a new connector onto an
empty area
|
java.awt.Color |
getEditorBackground()
The background color for the design panels
|
IGridSettings |
getGridSettings()
Returns the settings for the grid/guide/snapping system
|
DesignableDelegate |
getItemDelegate(DesignableContainer container)
Called to provide the DesignableDelegate that is appropriate for the given DesignableContainer
|
BlockDesignableContainer |
getSelectedContainer()
The currently selected designable container, or null if none is selected
|
boolean |
isRootSelected() |
protected ConnectionPainter |
newConnectionPainter(BlockDiagramModel model) |
protected BlockDesignableContainer |
newDesignableContainer(BlockDiagramModel model) |
protected EdgeRouter |
newEdgeRouter(BlockDiagramModel model) |
protected IDesignTool |
newSelectionTool() |
protected void |
onClose(DesignableContainer container)
Provides subclasses a chance to handle when a tab is closed
|
protected void |
open(BlockDiagramModel model) |
abstract java.util.Collection<Block> |
pasteBlocks(java.lang.String xml)
Deserialized previously serialized blocks (from
copyBlocks(Collection) ), and return them. |
addDesignableWorkspaceListener, close, findDesignableContainer, findDesignableContainer, findDropTarget, getAcceptableDropActions, getCurrentTool, getDefaultScope, getOpenContainerCount, getSelectedDesignPanel, getSelectedItems, getSelectedItemsCount, getSelectionControl, getSelectionPopupMenu, getSelectionTool, getTabToolTip, handleDoubleClick, handleDrop, handleEditClick, isDesignTime, isOpen, isOpen, isOpen, isZoomingEnabled, newDesignPanel, newLogger, onBeforeClose, onCurrentToolChanged, onEditorPaint, open, openArbitraryTab, paintInteractionLayerHigh, paintInteractionLayerLow, removeDesignableWorkspaceListener, removeTab, restrictMovementToParentBounds, setCurrentTool, setDesignTime, setSelectedContainer, setSelectedItems, setSelectedItems, setStatusMessage, toggleItemSelection, updateMouseLocation, updateSelectionControl, updateStatusBarText
add, addNotify, addTabEditingListener, calculateTabListPopupPosition, cancelTabEditing, clearVisComp, createFocusChangeListener, createNoFocusButton, createTabList, createTabListPopup, editTabAt, fireStateChanged, fireTabEditing, getCloseAction, getColorTheme, getContentBorderInsets, getDefaultColorTheme, getDefaultTabResizeMode, getDefaultTabStyle, getDisplayTitleAt, getEditingTabIndex, getIconForTab, getLastFocusedComponent, getPageLastFocusTrackers, getResourceString, getSelectedTabFont, getStringConverter, getTabAlignment, getTabAreaInsets, getTabAtLocation, getTabColorProvider, getTabEditingListeners, getTabEditingValidator, getTabHeight, getTabInsets, getTabLeadingComponent, getTabListCellRenderer, getTabResizeMode, getTabShape, getTabTrailingComponent, getUI, getUIClassID, hasFocusComponent, hideTabListPopup, insertTab, isAutoFocusOnTabHideClose, isAutoRequestFocus, isBoldActiveTab, isCloseTabOnMouseMiddleButton, isDragOverDisabled, isHideOneTab, isHideTrailingWhileNoButtons, isLayoutTrailingComponentBeforeButtons, isRightClickSelect, isScrollSelectedTabOnWheel, isShowCloseButton, isShowCloseButtonOnMouseOver, isShowCloseButtonOnSelectedTab, isShowCloseButtonOnTab, isShowGripper, isShowIconsOnTab, isShowTabArea, isShowTabButtons, isShowTabContent, isSuppressSetSelectedIndex, isSuppressStateChangedEvents, isTabClosableAt, isTabEditing, isTabEditingAllowed, isTabListPopupVisible, isTabShown, isUseDefaultShowCloseButtonOnTab, isUseDefaultShowIconsOnTab, moveSelectedTabTo, popupSelectedIndex, processMouseSelection, removeNotify, removeTabAt, removeTabEditingListener, repaintContentBorder, repaintTabAreaAndContentBorder, requestFocusForVisibleComponent, resetDefaultCloseAction, scrollSelectedTabToVisible, setAutoFocusOnTabHideClose, setAutoRequestFocus, setBoldActiveTab, setCloseAction, setCloseTabOnMouseMiddleButton, setColorTheme, setComponentAt, setContentBorderInsets, setDragOverDisabled, setHideOneTab, setHideTrailingWhileNoButtons, setLayoutTrailingComponentBeforeButtons, setRightClickSelect, setScrollSelectedTabOnWheel, setSelectedIndex, setSelectedTabFont, setShowCloseButton, setShowCloseButtonOnMouseOver, setShowCloseButtonOnSelectedTab, setShowCloseButtonOnTab, setShowGripper, setShowIconsOnTab, setShowTabArea, setShowTabButtons, setShowTabContent, setStringConverter, setSuppressSetSelectedIndex, setSuppressStateChangedEvents, setTabAlignment, setTabAreaInsets, setTabClosableAt, setTabColorProvider, setTabEditingAllowed, setTabEditingValidator, setTabInsets, setTabLeadingComponent, setTabListCellRenderer, setTabResizeMode, setTabShape, setTabTrailingComponent, setUI, setUseDefaultShowCloseButtonOnTab, setUseDefaultShowIconsOnTab, showTabListPopup, stopTabEditing, updateUI
add, add, add, add, addChangeListener, addTab, addTab, addTab, createChangeListener, getAccessibleContext, getBackgroundAt, getBoundsAt, getChangeListeners, getComponentAt, getDisabledIconAt, getDisplayedMnemonicIndexAt, getForegroundAt, getIconAt, getMnemonicAt, getModel, getSelectedComponent, getSelectedIndex, getTabComponentAt, getTabCount, getTabLayoutPolicy, getTabPlacement, getTabRunCount, getTitleAt, getToolTipText, getToolTipTextAt, indexAtLocation, indexOfComponent, indexOfTab, indexOfTab, indexOfTabComponent, isEnabledAt, paramString, remove, remove, removeAll, removeChangeListener, setBackgroundAt, setDisabledIconAt, setDisplayedMnemonicIndexAt, setEnabledAt, setForegroundAt, setIconAt, setMnemonicAt, setModel, setSelectedComponent, setTabComponentAt, setTabLayoutPolicy, setTabPlacement, setTitleAt, setToolTipTextAt
addAncestorListener, 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, 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
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, 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, 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
protected BasicGridSettings gridSettings
protected AbstractBlockWorkspace(ProjectScope scope)
public BlockDesignableContainer getSelectedContainer()
AbstractDesignableWorkspace
getSelectedContainer
in class AbstractDesignableWorkspace
protected void open(BlockDiagramModel model)
protected BlockDesignableContainer newDesignableContainer(BlockDiagramModel model)
public javax.swing.JPopupMenu createConnectorEndMenu(BlockDiagramModel model, AnchorPoint startAnchor, java.awt.Point end)
protected void onClose(DesignableContainer container)
AbstractDesignableWorkspace
onClose
in class AbstractDesignableWorkspace
public DesignableDelegate getItemDelegate(DesignableContainer container)
AbstractDesignableWorkspace
getItemDelegate
in class AbstractDesignableWorkspace
public java.awt.Color getEditorBackground()
AbstractDesignableWorkspace
getEditorBackground
in class AbstractDesignableWorkspace
public IGridSettings getGridSettings()
AbstractDesignableWorkspace
getGridSettings
in class AbstractDesignableWorkspace
protected IDesignTool newSelectionTool()
newSelectionTool
in class AbstractDesignableWorkspace
protected EdgeRouter newEdgeRouter(BlockDiagramModel model)
protected ConnectionPainter newConnectionPainter(BlockDiagramModel model)
public boolean isRootSelected()
public abstract java.lang.String copyBlocks(java.util.Collection<Block> blocks) throws SerializationException
pasteBlocks(String)
SerializationException
public abstract java.util.Collection<Block> pasteBlocks(java.lang.String xml)
copyBlocks(Collection)
), and return them. If an error
occurs, catch and display it, then return null