|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
CH.ifa.draw.standard.StandardDrawingView
org.openbp.cockpit.modeler.drawing.WorkspaceDrawingView
public class WorkspaceDrawingView
This is the standard drawing view of the modeler.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
javax.swing.JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static int |
GRIDTYPE_HEX
Grid type: Hexadecimal grid |
static int |
GRIDTYPE_LINE
Grid type: Line |
static int |
GRIDTYPE_POINT
Grid type: Point |
protected boolean |
mouseInView
Indicates that the mouse moves within the view |
| Fields inherited from class CH.ifa.draw.standard.StandardDrawingView |
|---|
MINIMUM_HEIGHT, MINIMUM_WIDTH, SCROLL_INCR, SCROLL_OFFSET |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
WorkspaceDrawingView(DrawingEditorPlugin editor)
Constructor. |
|
| Method Summary | |
|---|---|
protected void |
addBreakoutSupport(java.lang.String actionName,
int keyCode)
Adds breakout support for the specified key. |
void |
addToSelection(CH.ifa.draw.framework.Figure figure)
Adds a figure to the current selection. |
int |
applyScale(int coordinate,
boolean scaleToDoc)
Applies the current scale factor of the view to a coordinate. |
java.awt.Point |
applyScale(java.awt.Point p,
boolean scaleToDoc)
Applies the current scale factor of the view to a point. |
java.awt.Rectangle |
applyScale(java.awt.Rectangle r,
boolean scaleToDoc)
Applies the current scale factor of the view to a rectangle. |
void |
clearSelection()
Clears the current selection. |
void |
displayPopupMenu(CH.ifa.draw.framework.Figure figure,
java.awt.event.MouseEvent me)
Displays the popup menu for the given figure. |
void |
draw(java.awt.Graphics g,
CH.ifa.draw.framework.FigureEnumeration fe)
Override for adding scale effect. |
void |
drawAll(java.awt.Graphics g)
Overrides StandardDrawingView for adding scale effect. |
void |
drawBackground(java.awt.Graphics g)
Draws the background. |
void |
drawHandles(java.awt.Graphics g)
Draws the currently active handles. |
void |
drawingInvalidated(CH.ifa.draw.framework.DrawingChangeEvent e)
Adds a rectangle to the damage section after transforming it using the shadow layouter. |
void |
drawingRequestUpdate(CH.ifa.draw.framework.DrawingChangeEvent e)
|
void |
drawShadow(java.awt.Graphics g)
Paints the Shadow of the process view. |
CH.ifa.draw.framework.Handle |
findHandle(int x,
int y)
Finds a handle at the given coordinates. |
void |
fireSelectionChanged()
In addition to the super method, we fire an modeler.view.selectionchanged event. |
CH.ifa.draw.framework.Figure |
getFigureUnderCursor()
Gets the figure currently under the cursor or null. |
int |
getGridSpacing()
Gets the grid spacing. |
int |
getGridType()
Gets the grid layout type. |
java.awt.Dimension |
getMinimumSize()
|
java.awt.Dimension |
getPreferredSize()
Links the preferred size of the component to the size of the drawing. |
double |
getScaleFactor()
Gets the scaling factor. |
ShadowLayouter |
getShadowLayouter()
Gets the shadow layouter. |
java.lang.String |
getToolTipText(java.awt.event.MouseEvent e)
Returns the tool tip for the given mouse event (i\.e\. the given position). |
boolean |
isFigureSelected(CH.ifa.draw.framework.Figure checkFigure)
Tests whether a given figure is selected. |
boolean |
isGridDisplayed()
Gets the grid visibility. |
void |
keyPressed(java.awt.event.KeyEvent e)
Handles key down events. |
void |
keyReleased(java.awt.event.KeyEvent e)
Handles key up events. |
void |
prepareGraphics(java.awt.Graphics2D g2)
Prepares a graphics context for rendering. |
void |
redraw()
Redraws the view. |
void |
removeFromSelection(CH.ifa.draw.framework.Figure figure)
Removes a figure from the selection. |
void |
scrollIntoView(CH.ifa.draw.framework.Figure figure,
boolean addEnlargement)
Scrolls a figure container into view. |
void |
scrollRectToVisible(java.awt.Rectangle rect)
|
java.util.Vector |
selection()
|
int |
selectionCount()
Gets the number of selected figures. |
java.util.Vector |
selectionZOrdered()
|
void |
setCursor(java.awt.Cursor cursor)
Sets the current cursor. |
void |
setDrawing(CH.ifa.draw.framework.Drawing drawing)
|
void |
setFigureUnderCursor(CH.ifa.draw.framework.Figure figureUnderCursor)
Sets the figure currently under the cursor or null. |
void |
setGridDisplayed(boolean gridDisplayed)
Sets the grid visibility. |
void |
setGridSpacing(int gridSpacing)
Sets the grid spacing. |
void |
setGridType(int gridType)
Sets the grid layout type. |
void |
setPreferredSize(java.awt.Dimension d)
|
void |
setScaleFactor(double scaleFactor)
Sets the scaling factor. |
void |
setShadowLayouter(ShadowLayouter shadowLayouter)
Sets the shadow layouter. |
void |
setSizeOffset(int sizeOffset)
Sets the size offset for workspace view enlargement. |
void |
setVisibleRect(java.awt.Rectangle r)
Adjusts the scaling factor and view position according to the given rectangle. |
void |
singleSelect(CH.ifa.draw.framework.Figure figure)
|
void |
unregister()
Performs necessary cleanup-work when the view is not needed anymore - should allow the view to be processed by the garbage-collection. |
void |
updateSelection()
Notifies the property browser of selection changes. |
| Methods inherited from class CH.ifa.draw.standard.StandardDrawingView |
|---|
add, addAll, addBackground, addFigureSelectionListener, addForeground, addToSelectionAll, addToSelectionAll, autoscroll, checkDamage, constrainPoint, drawDrawing, drawing, editor, figureExists, freezeView, getAutoscrollInsets, getConnectionFigures, getConstrainer, getDefaultDNDActions, getDisplayUpdate, getFigureSelection, handleCursorKey, insertFigures, isFocusTraversable, isInteractive, keyTyped, lastClick, paintComponent, remove, removeBackground, removeFigureSelectionListener, removeForeground, repairDamage, selectionElements, setConstrainer, setDisplayUpdate, setEditor, toggleSelection, tool, toString, unfreezeView |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
|---|
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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, 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, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
|---|
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, 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, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, 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, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface CH.ifa.draw.framework.DrawingView |
|---|
createImage, getBackground, getGraphics, getSize, paint, setBackground |
| Methods inherited from interface java.awt.image.ImageObserver |
|---|
imageUpdate |
| Field Detail |
|---|
public static final int GRIDTYPE_POINT
public static final int GRIDTYPE_LINE
public static final int GRIDTYPE_HEX
protected boolean mouseInView
| Constructor Detail |
|---|
public WorkspaceDrawingView(DrawingEditorPlugin editor)
editor - Editor that uses the view| Method Detail |
|---|
public void unregister()
public void setDrawing(CH.ifa.draw.framework.Drawing drawing)
setDrawing in interface CH.ifa.draw.framework.DrawingViewsetDrawing in class CH.ifa.draw.standard.StandardDrawingViewpublic java.awt.Dimension getPreferredSize()
getPreferredSize in interface CH.ifa.draw.framework.DrawingViewgetPreferredSize in class CH.ifa.draw.standard.StandardDrawingViewpublic java.awt.Dimension getMinimumSize()
getMinimumSize in interface CH.ifa.draw.framework.DrawingViewgetMinimumSize in class CH.ifa.draw.standard.StandardDrawingViewpublic void setPreferredSize(java.awt.Dimension d)
setPreferredSize in class javax.swing.JComponentpublic void setCursor(java.awt.Cursor cursor)
setCursor in interface CH.ifa.draw.framework.DrawingViewsetCursor in class java.awt.Componentpublic java.lang.String getToolTipText(java.awt.event.MouseEvent e)
getToolTipText in class javax.swing.JComponente - Current mouse event specifying the position of the cursor
public void redraw()
public void drawBackground(java.awt.Graphics g)
drawBackground in interface CH.ifa.draw.framework.DrawingViewdrawBackground in class CH.ifa.draw.standard.StandardDrawingViewg - Graphics object to draw topublic void drawShadow(java.awt.Graphics g)
g - the graphics object where the shadow has to paintpublic void drawAll(java.awt.Graphics g)
drawAll in interface CH.ifa.draw.framework.DrawingViewdrawAll in class CH.ifa.draw.standard.StandardDrawingViewg - Graphics object to draw to
public void draw(java.awt.Graphics g,
CH.ifa.draw.framework.FigureEnumeration fe)
draw in interface CH.ifa.draw.framework.DrawingViewdraw in class CH.ifa.draw.standard.StandardDrawingViewpublic void prepareGraphics(java.awt.Graphics2D g2)
g2 - Graphics to preprarepublic void drawHandles(java.awt.Graphics g)
drawHandles in interface CH.ifa.draw.framework.DrawingViewdrawHandles in class CH.ifa.draw.standard.StandardDrawingViewg - Graphics object to draw to
public void scrollIntoView(CH.ifa.draw.framework.Figure figure,
boolean addEnlargement)
figure - Figure to showaddEnlargement - true: Adds an offset of 50 px to the display box of the element.public void scrollRectToVisible(java.awt.Rectangle rect)
scrollRectToVisible in class javax.swing.JComponentpublic void drawingRequestUpdate(CH.ifa.draw.framework.DrawingChangeEvent e)
drawingRequestUpdate in interface CH.ifa.draw.framework.DrawingChangeListenerdrawingRequestUpdate in class CH.ifa.draw.standard.StandardDrawingViewpublic void drawingInvalidated(CH.ifa.draw.framework.DrawingChangeEvent e)
drawingInvalidated in interface CH.ifa.draw.framework.DrawingChangeListenerdrawingInvalidated in class CH.ifa.draw.standard.StandardDrawingViewe - The DrawingChangeEvent that describes the invalidation
public java.awt.Rectangle applyScale(java.awt.Rectangle r,
boolean scaleToDoc)
r - rectangle to be scaledscaleToDoc - true: Assumes that the coordinates are component coordinates that should be translated to document coordinates.
public java.awt.Point applyScale(java.awt.Point p,
boolean scaleToDoc)
p - Point to be scaledscaleToDoc - true: Assumes that the coordinates are component coordinates that should be translated to document coordinates.
public int applyScale(int coordinate,
boolean scaleToDoc)
coordinate - X or Y coordinate to be scaledscaleToDoc - true: Assumes that the coordinates are component coordinates that should be translated to document coordinates.public void setVisibleRect(java.awt.Rectangle r)
r - Rectangle to scroll into viewpublic double getScaleFactor()
getScaleFactor in interface Scalablepublic void setScaleFactor(double scaleFactor)
setScaleFactor in interface Scalablepublic int selectionCount()
selectionCount in interface CH.ifa.draw.framework.DrawingViewselectionCount in class CH.ifa.draw.standard.StandardDrawingViewpublic boolean isFigureSelected(CH.ifa.draw.framework.Figure checkFigure)
isFigureSelected in interface CH.ifa.draw.framework.DrawingViewisFigureSelected in class CH.ifa.draw.standard.StandardDrawingViewpublic java.util.Vector selection()
selection in interface CH.ifa.draw.framework.DrawingViewselection in class CH.ifa.draw.standard.StandardDrawingViewpublic java.util.Vector selectionZOrdered()
selectionZOrdered in interface CH.ifa.draw.framework.DrawingViewselectionZOrdered in class CH.ifa.draw.standard.StandardDrawingViewpublic void addToSelection(CH.ifa.draw.framework.Figure figure)
addToSelection in interface CH.ifa.draw.framework.DrawingViewaddToSelection in class CH.ifa.draw.standard.StandardDrawingViewpublic void removeFromSelection(CH.ifa.draw.framework.Figure figure)
removeFromSelection in interface CH.ifa.draw.framework.DrawingViewremoveFromSelection in class CH.ifa.draw.standard.StandardDrawingViewpublic void singleSelect(CH.ifa.draw.framework.Figure figure)
public void clearSelection()
clearSelection in interface CH.ifa.draw.framework.DrawingViewclearSelection in class CH.ifa.draw.standard.StandardDrawingViewpublic void fireSelectionChanged()
fireSelectionChanged in class CH.ifa.draw.standard.StandardDrawingViewpublic void updateSelection()
public CH.ifa.draw.framework.Handle findHandle(int x,
int y)
findHandle in interface CH.ifa.draw.framework.DrawingViewfindHandle in class CH.ifa.draw.standard.StandardDrawingViewx - Document coordinatesy - Document coordinates
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenerkeyPressed in class CH.ifa.draw.standard.StandardDrawingViewpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenerkeyReleased in class CH.ifa.draw.standard.StandardDrawingView
public void displayPopupMenu(CH.ifa.draw.framework.Figure figure,
java.awt.event.MouseEvent me)
figure - Figure to display the menu forme - Mouse event that caused the popup display or null if the popup has been initiated by a key
protected void addBreakoutSupport(java.lang.String actionName,
int keyCode)
actionName - Arbitrary name of the breakout support actionkeyCode - Key code that will initiate the breakout modepublic ShadowLayouter getShadowLayouter()
public void setShadowLayouter(ShadowLayouter shadowLayouter)
public CH.ifa.draw.framework.Figure getFigureUnderCursor()
public void setFigureUnderCursor(CH.ifa.draw.framework.Figure figureUnderCursor)
public boolean isGridDisplayed()
public void setGridDisplayed(boolean gridDisplayed)
public int getGridType()
public void setGridType(int gridType)
public int getGridSpacing()
public void setGridSpacing(int gridSpacing)
public void setSizeOffset(int sizeOffset)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||