edu.byu.deg.OntologyEditor.shapes
Class ObjectShape
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
edu.byu.deg.OntologyEditor.shapes.DrawShape
edu.byu.deg.OntologyEditor.shapes.PlanarShape
edu.byu.deg.OntologyEditor.shapes.ConnectableShape
edu.byu.deg.OntologyEditor.shapes.ObjConnectableShape
edu.byu.deg.OntologyEditor.shapes.ObjectShape
- All Implemented Interfaces:
- Accessible, CustomCoordinatePlane, DocumentListener, EventListener, ImageObserver, ItemSelectable, MenuContainer, edu.byu.deg.osmx.OSMXElement.OSMXElementDeletionListener, edu.byu.deg.osmx.PositionListener, Serializable
- public class ObjectShape
- extends ObjConnectableShape
- implements DocumentListener
- See Also:
- Serialized Form
| Fields inherited from class java.awt.Container |
|
|
Constructor Summary |
ObjectShape(Container c,
edu.byu.deg.osmx.OSMXElement elem)
Creates a new instance of ObjectShape |
| 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, getStroke, getStyle, getTopPoint, isSelected, locationChanged, locationChanged, normalizeRect, removeItemListener, setLocation, setLocation, setSelected, setSelected |
| 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 |
objName
protected String objName
obj
protected edu.byu.deg.osmx.OSMXObjectType obj
suppressDocEvents
protected boolean suppressDocEvents
objNameText
protected TextShape objNameText
canvasSizeListener
protected ComponentAdapter canvasSizeListener
centerRegion
protected Ellipse2D centerRegion
objectPanel
protected edu.byu.deg.OntologyEditor.shapes.ObjectShape.ObjectPanel objectPanel
centerPoint
protected Point centerPoint
m_selColor
protected static Color m_selColor
OBJECT_RADIUS
protected static final int OBJECT_RADIUS
- See Also:
- Constant Field Values
ObjectShape
public ObjectShape(Container c,
edu.byu.deg.osmx.OSMXElement elem)
- Creates a new instance of ObjectShape
centerPointMoved
protected void centerPointMoved()
contains
public boolean contains(int x,
int y)
contains
public boolean contains(Point point)
delete
public void delete()
- Description copied from class:
DrawShape
- Passes a delete request to the internal OSMX element, which is responsible for
removing itself from the model and firing deletion events to registered
listeners (including this shape, so it can remove itself from its container).
- Overrides:
delete in class DrawShape
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 DrawShape
- Returns:
- The bounds of this shape.
getCenterPoint
public Point getCenterPoint()
- Description copied from class:
DrawShape
- Calculates the center point of the shape, in the coordinate system of the shape.
- Overrides:
getCenterPoint in class DrawShape
- Returns:
- The center point of the shape (width/2, height/2).
getCenterRegion
protected Ellipse2D getCenterRegion()
getIntersectionPoint
public Point2D.Double getIntersectionPoint(Point2D.Double pt)
- Overrides:
getIntersectionPoint in class ConnectableShape
getPosition
public Point getPosition()
- Description copied from class:
DrawShape
- Returns the horizontal and vertical position of this shape's origin point
relative to its container's origin point. This may be different than the value
returned by
Component.getLocation() in situations where the shape's origin point
is not at the northwest corner of the shape's bounding box.
- Overrides:
getPosition in class DrawShape
- Returns:
- The position of the shape's origin point relative to its container's origin
point.
- See Also:
DrawShape.getOrigin(),
CustomCoordinatePlane
getObject
public edu.byu.deg.osmx.binding.ObjectType getObject()
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
getShapeName
public String getShapeName()
initCenterPoint
protected void initCenterPoint()
initName
protected void initName()
initObject
protected void initObject()
initSize
protected void initSize()
masksConnectionsAt
public boolean masksConnectionsAt(Point pt)
paintComponent
public void paintComponent(Graphics g)
repositionName
protected void repositionName()
repositionObject
protected void repositionObject()
setLocationFromPosition
protected void setLocationFromPosition()
- Overrides:
setLocationFromPosition in class PlanarShape
setPosition
protected void setPosition(Point pt)
- Description copied from class:
DrawShape
- Changes the shape's position to the specified
Point.
- Overrides:
setPosition in class PlanarShape
setPosition
protected void setPosition(int x,
int y)
- Description copied from class:
DrawShape
- Changes the shape's position to the specified x and y coordinates.
- Overrides:
setPosition in class PlanarShape
setShapeName
protected void setShapeName(String s)
updatePosition
protected void updatePosition()
- Overrides:
updatePosition in class PlanarShape
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 ObjConnectableShape
locationChanged
protected void locationChanged()
- Overrides:
locationChanged in class PlanarShape
changedUpdate
public void changedUpdate(DocumentEvent e)
- Specified by:
changedUpdate in interface DocumentListener
insertUpdate
public void insertUpdate(DocumentEvent e)
- Specified by:
insertUpdate in interface DocumentListener
removeUpdate
public void removeUpdate(DocumentEvent e)
- Specified by:
removeUpdate in interface DocumentListener