unbbayes.draw
Class UCanvas
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLayeredPane
unbbayes.draw.UCanvas
- All Implemented Interfaces:
- ComponentListener, KeyListener, MouseListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible
- Direct Known Subclasses:
- GraphPane
public class UCanvas
- extends JLayeredPane
- implements MouseMotionListener, MouseListener, ComponentListener, KeyListener
- See Also:
- Serialized Form
Method Summary |
void |
addShape(UShape shape)
|
void |
checkSelectArea()
|
void |
componentHidden(ComponentEvent arg0)
|
void |
componentMoved(ComponentEvent arg0)
|
void |
componentResized(ComponentEvent arg0)
|
void |
componentShown(ComponentEvent arg0)
|
UShapeLine |
connectLinesForAllSelectedShape(UShape shapeParent,
UShape shapeTarget)
|
void |
DeleteSelectedShape()
|
void |
delShape(UShape shape)
|
void |
drawResizeRectEnter(Rectangle rc)
|
void |
drawResizeRectReleased(Rectangle rc)
|
void |
fitCanvasSizeToAllUShapes()
|
NetworkController |
getController()
|
UShape |
getNodeUShape(Node n)
Does a linear search for a UShape instance containing a node n |
UShape |
getNodeUShape(UShape parent,
Node n)
|
UShape |
getSelectedShape()
|
List<UShape> |
getSelectedShapes()
|
Node |
getSelectedShapesNode()
|
UShape |
GetShape(int x,
int y)
|
UShape |
GetShape(UShape parent,
int x,
int y)
|
String |
getState()
|
String |
getTextOutputMode()
|
void |
keyPressed(KeyEvent arg0)
|
void |
keyReleased(KeyEvent arg0)
|
void |
keyTyped(KeyEvent arg0)
|
void |
mouseClicked(MouseEvent e)
|
void |
mouseDragged(int x,
int y)
|
void |
mouseDragged(MouseEvent e)
|
void |
mouseEntered(MouseEvent e)
|
void |
mouseExited(MouseEvent e)
|
void |
mouseMoved(MouseEvent e)
|
void |
mousePressed(int x,
int y)
|
void |
mousePressed(MouseEvent e)
|
void |
mouseReleased(int x,
int y)
|
void |
mouseReleased(MouseEvent e)
|
void |
onAlignNodes(String str)
|
void |
onDrawConnectLineEnter(int x,
int y)
|
UShapeLine |
onDrawConnectLineReleased(UShape shapeParent,
int x,
int y)
|
void |
onPositionChanged(UShape s)
|
void |
onResized(UShape s)
|
void |
onResizeToFitText()
|
void |
onSelectionChanged()
|
void |
onShapeChanged(UShape s)
|
void |
onShapeColorChanged(Color c)
|
void |
onShapeDeleted(UShape s)
|
void |
onShapeMoved(UShape shapeMoved,
int x,
int y)
|
void |
onShapeTypeChanged(String s)
|
void |
paintComponent(Graphics g)
|
void |
setController(NetworkController controller)
|
UShape |
setDiamond(int x,
int y,
int width,
int height)
|
UShape |
setEllipse(int x,
int y,
int width,
int height)
|
UShape |
setFrame(int x,
int y,
int width,
int height)
|
UShape |
setPentagon(int x,
int y,
int width,
int height)
|
UShape |
setRect(int x,
int y,
int width,
int height)
|
UShape |
setRoundRect(int x,
int y,
int width,
int height)
|
void |
setShapeStateAll(String s,
Object o)
|
void |
setShapeStateAll(UShape parent,
String s,
Object o)
|
void |
setState(String s)
|
void |
setTextOutputMode(String str)
|
UShape |
setTrapezoid(int x,
int y,
int width,
int height)
|
void |
update()
|
protected void |
updateLines()
|
Methods inherited from class javax.swing.JLayeredPane |
addImpl, getAccessibleContext, getComponentCountInLayer, getComponentsInLayer, getComponentToLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getObjectForLayer, getPosition, highestLayer, insertIndexForLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, paramString, putLayer, remove, removeAll, setLayer, setLayer, setPosition |
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, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, 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, 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 |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, 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, 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, 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, transferFocusUpCycle |
layerID
protected int layerID
controller
protected NetworkController controller
STATE_NONE
public static final String STATE_NONE
- See Also:
- Constant Field Values
STATE_RESIZE_COMP
public static final String STATE_RESIZE_COMP
- See Also:
- Constant Field Values
STATE_CONNECT_COMP
public static final String STATE_CONNECT_COMP
- See Also:
- Constant Field Values
STATE_UPDATE
public static final String STATE_UPDATE
- See Also:
- Constant Field Values
STATE_CTRL
public static final String STATE_CTRL
- See Also:
- Constant Field Values
NODE_ALIGN_BOTTOM
public static final String NODE_ALIGN_BOTTOM
- See Also:
- Constant Field Values
NODE_ALIGN_TOP
public static final String NODE_ALIGN_TOP
- See Also:
- Constant Field Values
NODE_ALIGN_LEFT
public static final String NODE_ALIGN_LEFT
- See Also:
- Constant Field Values
NODE_ALIGN_RIGHT
public static final String NODE_ALIGN_RIGHT
- See Also:
- Constant Field Values
m_state
public String m_state
resizeRect
public Rectangle resizeRect
dragRect
public Rectangle dragRect
selectRect
public Rectangle selectRect
dragPoint
public Point dragPoint
strTextOutputMode
public String strTextOutputMode
selectedShapes
public List<UShape> selectedShapes
TEXTOUTPUTMODEMODE_NONE
public static final String TEXTOUTPUTMODEMODE_NONE
- See Also:
- Constant Field Values
TEXTOUTPUTMODEMODE_USE_NAME
public static final String TEXTOUTPUTMODEMODE_USE_NAME
- See Also:
- Constant Field Values
TEXTOUTPUTMODEMODE_USE_DESC
public static final String TEXTOUTPUTMODEMODE_USE_DESC
- See Also:
- Constant Field Values
shapeTest
public UShape shapeTest
UCanvas
public UCanvas()
setTextOutputMode
public void setTextOutputMode(String str)
getTextOutputMode
public String getTextOutputMode()
setState
public void setState(String s)
getState
public String getState()
getNodeUShape
public UShape getNodeUShape(Node n)
- Does a linear search for a UShape instance containing a node n
- Parameters:
n
- : node to look for
- Returns:
- an instance of UShape representing the parameter n.
getNodeUShape
public UShape getNodeUShape(UShape parent,
Node n)
fitCanvasSizeToAllUShapes
public void fitCanvasSizeToAllUShapes()
getSelectedShapes
public List<UShape> getSelectedShapes()
DeleteSelectedShape
public void DeleteSelectedShape()
update
public void update()
onResized
public void onResized(UShape s)
onPositionChanged
public void onPositionChanged(UShape s)
onResizeToFitText
public void onResizeToFitText()
onShapeColorChanged
public void onShapeColorChanged(Color c)
onShapeTypeChanged
public void onShapeTypeChanged(String s)
onShapeDeleted
public void onShapeDeleted(UShape s)
onShapeChanged
public void onShapeChanged(UShape s)
onSelectionChanged
public void onSelectionChanged()
onAlignNodes
public void onAlignNodes(String str)
getSelectedShapesNode
public Node getSelectedShapesNode()
getSelectedShape
public UShape getSelectedShape()
paintComponent
public void paintComponent(Graphics g)
- Overrides:
paintComponent
in class JComponent
setShapeStateAll
public void setShapeStateAll(String s,
Object o)
setShapeStateAll
public void setShapeStateAll(UShape parent,
String s,
Object o)
drawResizeRectEnter
public void drawResizeRectEnter(Rectangle rc)
drawResizeRectReleased
public void drawResizeRectReleased(Rectangle rc)
onShapeMoved
public void onShapeMoved(UShape shapeMoved,
int x,
int y)
onDrawConnectLineEnter
public void onDrawConnectLineEnter(int x,
int y)
onDrawConnectLineReleased
public UShapeLine onDrawConnectLineReleased(UShape shapeParent,
int x,
int y)
connectLinesForAllSelectedShape
public UShapeLine connectLinesForAllSelectedShape(UShape shapeParent,
UShape shapeTarget)
GetShape
public UShape GetShape(int x,
int y)
GetShape
public UShape GetShape(UShape parent,
int x,
int y)
checkSelectArea
public void checkSelectArea()
setRect
public UShape setRect(int x,
int y,
int width,
int height)
setEllipse
public UShape setEllipse(int x,
int y,
int width,
int height)
setFrame
public UShape setFrame(int x,
int y,
int width,
int height)
setRoundRect
public UShape setRoundRect(int x,
int y,
int width,
int height)
setTrapezoid
public UShape setTrapezoid(int x,
int y,
int width,
int height)
setPentagon
public UShape setPentagon(int x,
int y,
int width,
int height)
setDiamond
public UShape setDiamond(int x,
int y,
int width,
int height)
addShape
public void addShape(UShape shape)
delShape
public void delShape(UShape shape)
mouseDragged
public void mouseDragged(int x,
int y)
mouseDragged
public void mouseDragged(MouseEvent e)
- Specified by:
mouseDragged
in interface MouseMotionListener
mouseMoved
public void mouseMoved(MouseEvent e)
- Specified by:
mouseMoved
in interface MouseMotionListener
mouseClicked
public void mouseClicked(MouseEvent e)
- Specified by:
mouseClicked
in interface MouseListener
mouseEntered
public void mouseEntered(MouseEvent e)
- Specified by:
mouseEntered
in interface MouseListener
mouseExited
public void mouseExited(MouseEvent e)
- Specified by:
mouseExited
in interface MouseListener
mousePressed
public void mousePressed(int x,
int y)
mousePressed
public void mousePressed(MouseEvent e)
- Specified by:
mousePressed
in interface MouseListener
mouseReleased
public void mouseReleased(int x,
int y)
mouseReleased
public void mouseReleased(MouseEvent e)
- Specified by:
mouseReleased
in interface MouseListener
componentHidden
public void componentHidden(ComponentEvent arg0)
- Specified by:
componentHidden
in interface ComponentListener
componentMoved
public void componentMoved(ComponentEvent arg0)
- Specified by:
componentMoved
in interface ComponentListener
componentResized
public void componentResized(ComponentEvent arg0)
- Specified by:
componentResized
in interface ComponentListener
componentShown
public void componentShown(ComponentEvent arg0)
- Specified by:
componentShown
in interface ComponentListener
keyPressed
public void keyPressed(KeyEvent arg0)
- Specified by:
keyPressed
in interface KeyListener
keyReleased
public void keyReleased(KeyEvent arg0)
- Specified by:
keyReleased
in interface KeyListener
keyTyped
public void keyTyped(KeyEvent arg0)
- Specified by:
keyTyped
in interface KeyListener
getController
public NetworkController getController()
- Returns:
- the controller
setController
public void setController(NetworkController controller)
- Parameters:
controller
- the controller to set
updateLines
protected void updateLines()
Copyright © 2001-2010 University of Brasilia - UnB. All Rights Reserved.