Class JComponentItemDelegate
java.lang.Object
com.inductiveautomation.ignition.designer.designable.JComponentItemDelegate
- All Implemented Interfaces:
DesignableDelegate
- Direct Known Subclasses:
BlockDiagramItemDelegate
,StandaloneDelegate
An abstract DesignableDelegate that implements many functions using the size/locations provided by JComponent
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
protected Point
protected AffineTransform
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Rectangle2D
convertRect
(JComponent source, JComponent relativeTo, Rectangle2D r) Converts a rectangle from the coordinates of one component to another.protected Shape
convertShape
(JComponent source, JComponent relativeTo, Shape shape) Iterator<? extends JComponent>
findChildren
(JComponent container) Returns an iterator that iterates through the children of the given container in decreasing Z-order (highest layer to lowest layer)getBounds
(JComponent source, JComponent relativeTo, Rectangle2D rect) Fetch the current bounds of the given item, relative to the supplied JComponent.int
getChildCount
(JComponent container) Returns the count of the number of items currently held in the given containergetName
(JComponent object) Uses the JComponent's namegetOffsettingParent
(JComponent source) Find the parent component for whose bounds the component is relative to.Implemented using a client property with key "rotation.center" whose value is expected to be a Point2D.FloatgetShapeBounds
(JComponent item, JComponent relativeTo, Rectangle rect) Return non-rectangular bounds of the given item relative to the supplied JComponent.protected Rectangle2D
initRect
(Rectangle2D rv, Rectangle2D copyFrom) Initializes a return value rectangle rv, or creates a new one if it's null.void
setRotationAnchor
(JComponent object, Point2D point) Puts the given point on the JComponent using client property "rotation.center"Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.inductiveautomation.ignition.designer.designable.DesignableDelegate
addObject, copyMove, findObjectsAt, getParent, isContainer, isLocked, isMovable, isOffsettingParent, isRotateCapable, moveObject, notifyObjectsMoved, notifyObjectsRotated, rotateObject, scaleObject, setZOrderPosition
-
Field Details
-
ROTATION_CENTER_KEY
- See Also:
-
scratch
-
tx
-
-
Constructor Details
-
JComponentItemDelegate
public JComponentItemDelegate()
-
-
Method Details
-
getBounds
Description copied from interface:DesignableDelegate
Fetch the current bounds of the given item, relative to the supplied JComponent. If the rect argument is null, a new Rectangle should be instantiated and returned. Otherwise, rect should be modified and returned to avoid unnecessary Rectangle instantiation, because this function is called very frequently.- Specified by:
getBounds
in interfaceDesignableDelegate
-
initRect
Initializes a return value rectangle rv, or creates a new one if it's null. If copyFrom isn't null, then the rect is set to that size. -
getShapeBounds
Description copied from interface:DesignableDelegate
Return non-rectangular bounds of the given item relative to the supplied JComponent. If the bounds happen to be rectangular, you may alter the supplied rectangle to avoid instantiating a new shape.- Specified by:
getShapeBounds
in interfaceDesignableDelegate
-
getOffsettingParent
Find the parent component for whose bounds the component is relative to.- Specified by:
getOffsettingParent
in interfaceDesignableDelegate
-
convertRect
Converts a rectangle from the coordinates of one component to another. -
convertShape
-
getRotationAnchor
Implemented using a client property with key "rotation.center" whose value is expected to be a Point2D.Float- Specified by:
getRotationAnchor
in interfaceDesignableDelegate
-
setRotationAnchor
Puts the given point on the JComponent using client property "rotation.center"- Specified by:
setRotationAnchor
in interfaceDesignableDelegate
-
getName
Uses the JComponent's name- Specified by:
getName
in interfaceDesignableDelegate
-
findChildren
Description copied from interface:DesignableDelegate
Returns an iterator that iterates through the children of the given container in decreasing Z-order (highest layer to lowest layer)- Specified by:
findChildren
in interfaceDesignableDelegate
-
getChildCount
Description copied from interface:DesignableDelegate
Returns the count of the number of items currently held in the given container- Specified by:
getChildCount
in interfaceDesignableDelegate
-