edu.byu.deg.OntologyEditor.shapes
Class RelationshipSetShape

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byedu.byu.deg.OntologyEditor.shapes.DrawShape
                      extended byedu.byu.deg.OntologyEditor.shapes.PlanarShape
                          extended byedu.byu.deg.OntologyEditor.shapes.ConnectorShape
                              extended byedu.byu.deg.OntologyEditor.shapes.RelationshipSetShape
All Implemented Interfaces:
Accessible, CustomCoordinatePlane, ImageObserver, ItemSelectable, MenuContainer, edu.byu.deg.osmx.OSMXElement.OSMXElementDeletionListener, edu.byu.deg.osmx.OSMXElementList.ListObserver, edu.byu.deg.osmx.PositionListener, Serializable, edu.byu.deg.osmx.TextChangeListener

public class RelationshipSetShape
extends ConnectorShape
implements edu.byu.deg.osmx.TextChangeListener, edu.byu.deg.osmx.OSMXElementList.ListObserver

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  Ellipse2D centerRegion
           
protected  edu.byu.deg.OntologyEditor.shapes.RelationshipSetShape.DiamondPanel diamondPanel
           
static double HIGH_LEVEL_SCALE_FACTOR
           
static int MIN_DIAMOND_WIDTH
           
protected  JTextArea nameText
           
protected  edu.byu.deg.osmx.OSMXRelationshipSetType relSet
           
protected  boolean suppressDocEvents
           
 
Fields inherited from class edu.byu.deg.OntologyEditor.shapes.ConnectorShape
centerPoint, connections, floatingCenter, oldCenterPoint
 
Fields inherited from class edu.byu.deg.OntologyEditor.shapes.PlanarShape
posElem, positionChanging
 
Fields inherited from class edu.byu.deg.OntologyEditor.shapes.DrawShape
DEFAULT_FONT, DEFAULT_STROKE, DEFAULT_STYLE, element, elementListener, initialLocation, parentCanvas, rootCanvas, selected, shapeBorder
 
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.Container
 
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
RelationshipSetShape(Container c, edu.byu.deg.osmx.OSMXElement elem)
          Creates a new instance of RelationshipSetShape
 
Method Summary
 void addConnection(edu.byu.deg.osmx.OSMXRelSetConnectionType conn)
           
protected  void centerPointMoved()
           
 boolean contains(int x, int y)
           
 boolean contains(Point point)
           
 void elementAdded(edu.byu.deg.osmx.OSMXElement elem)
           
 void elementRemoved(edu.byu.deg.osmx.OSMXElement elem)
           
 Rectangle getBoundingBox()
          Return the bounds of this shape (as opposed to the panel containing this shape.
protected  Ellipse2D getCenterRegion()
           
 ConnectionShape getHeadConnection()
           
 Point getOrigin()
          Returns the origin point of this shape.
protected  edu.byu.deg.osmx.binding.RelationshipSetType getRelationshipSet()
           
 Stroke getStroke()
          Returns the standard Stroke for drawing this shape's outline.
 ConnectionShape getTailConnection()
           
protected  void initConnections()
           
protected  void initDiamond()
           
protected  void initName()
           
protected  void initNameArrow()
           
protected  void initRelSet()
           
 boolean masksConnectionsAt(Point pt)
           
protected  void paintArrow(Graphics g)
           
 void paintComponent(Graphics g)
           
protected  void repositionDiamond()
           
protected  void repositionName()
           
protected  boolean showDiamond()
           
 void textChanged(String newText)
           
 void updateArrow()
           
protected  void updateSelectionState()
          Invoked from ConnectorShape.setSelected(java.awt.Rectangle, boolean) after the DrawShape.selected flag has been updated, this method allows subclasses to respond to the change in selection state.
 
Methods inherited from class edu.byu.deg.OntologyEditor.shapes.ConnectorShape
anchorCenterPoint, delete, getCenterPoint, getPosition, initBorder, initCenterPoint, initLocation, initSize, locationChanged, locationChanged, recalculateCenterPoint, setLocation, setLocation, setLocationFromPosition, setPosition, setPosition, setSelected, storeInitialLocation, unanchorCenterPoint
 
Methods inherited from class edu.byu.deg.OntologyEditor.shapes.PlanarShape
initElement, locationChanged, updateOrder, updatePosition, updateX, updateY
 
Methods inherited from class edu.byu.deg.OntologyEditor.shapes.DrawShape
addItemListener, createStyle, drag, elementDeleted, elementPropertyChange, getAbsoluteCenterPoint, getBottomPoint, getConnectionPoint, getDefaultStyle, getElement, getFillColor, getFontColor, getFontFamily, getFontSize, getFontStyle, getLeftPoint, getLineColor, getLineWidth, getParentCanvas, getRightPoint, getRootCanvas, getSelectedObjects, getStyle, getTopPoint, isSelected, normalizeRect, removeItemListener, setSelected
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MIN_DIAMOND_WIDTH

public static final int MIN_DIAMOND_WIDTH
See Also:
Constant Field Values

HIGH_LEVEL_SCALE_FACTOR

public static final double HIGH_LEVEL_SCALE_FACTOR
See Also:
Constant Field Values

relSet

protected edu.byu.deg.osmx.OSMXRelationshipSetType relSet

suppressDocEvents

protected boolean suppressDocEvents

nameText

protected JTextArea nameText

diamondPanel

protected edu.byu.deg.OntologyEditor.shapes.RelationshipSetShape.DiamondPanel diamondPanel

centerRegion

protected Ellipse2D centerRegion
Constructor Detail

RelationshipSetShape

public RelationshipSetShape(Container c,
                            edu.byu.deg.osmx.OSMXElement elem)
Creates a new instance of RelationshipSetShape

Method Detail

initConnections

protected void initConnections()
Specified by:
initConnections in class ConnectorShape

addConnection

public void addConnection(edu.byu.deg.osmx.OSMXRelSetConnectionType conn)

initRelSet

protected void initRelSet()

initDiamond

protected void initDiamond()

repositionDiamond

protected void repositionDiamond()

repositionName

protected void repositionName()

centerPointMoved

protected void centerPointMoved()
Overrides:
centerPointMoved in class ConnectorShape

initNameArrow

protected void initNameArrow()

initName

protected void initName()

getOrigin

public Point getOrigin()
Description copied from class: DrawShape
Returns the origin point of this shape.

Specified by:
getOrigin in interface CustomCoordinatePlane
Overrides:
getOrigin in class DrawShape
Returns:
The origin point of the shape.
See Also:
CustomCoordinatePlane

elementAdded

public void elementAdded(edu.byu.deg.osmx.OSMXElement elem)
Specified by:
elementAdded in interface edu.byu.deg.osmx.OSMXElementList.ListObserver

elementRemoved

public void elementRemoved(edu.byu.deg.osmx.OSMXElement elem)
Specified by:
elementRemoved in interface edu.byu.deg.osmx.OSMXElementList.ListObserver

textChanged

public void textChanged(String newText)
Specified by:
textChanged in interface edu.byu.deg.osmx.TextChangeListener

updateArrow

public void updateArrow()

getRelationshipSet

protected edu.byu.deg.osmx.binding.RelationshipSetType getRelationshipSet()

contains

public boolean contains(int x,
                        int y)
Overrides:
contains in class ConnectorShape

contains

public boolean contains(Point point)
Overrides:
contains in class ConnectorShape

getBoundingBox

public Rectangle getBoundingBox()
Description copied from class: DrawShape
Return the bounds of this shape (as opposed to the panel containing this shape. Used, for example, to compute the drawing bounds for EPS export purposes. Subclasses should override this method when the containing panel bounds are not the same as the shape bounds. This is the case with connectors, for example. Shapes need to be sure to include text decorations (e.g., participation constraints, relationship-set names) and special symbols when computing bounds.

Overrides:
getBoundingBox in class ConnectorShape

getStroke

public Stroke getStroke()
Description copied from class: DrawShape
Returns the standard Stroke for drawing this shape's outline. Override in subclasses if the normal outline should be drawn differently.

Overrides:
getStroke in class DrawShape
Returns:
The Stroke normally used to draw the shape.

paintComponent

public void paintComponent(Graphics g)

getCenterRegion

protected Ellipse2D getCenterRegion()

paintArrow

protected void paintArrow(Graphics g)

showDiamond

protected boolean showDiamond()

getHeadConnection

public ConnectionShape getHeadConnection()
Specified by:
getHeadConnection in class ConnectorShape

getTailConnection

public ConnectionShape getTailConnection()
Specified by:
getTailConnection in class ConnectorShape

masksConnectionsAt

public boolean masksConnectionsAt(Point pt)
Specified by:
masksConnectionsAt in class ConnectorShape

updateSelectionState

protected void updateSelectionState()
Description copied from class: DrawShape
Invoked from DrawShape.setSelected(boolean) after the DrawShape.selected flag has been updated, this method allows subclasses to respond to the change in selection state.

Overrides:
updateSelectionState in class ConnectorShape