public class StandaloneDelegate extends JComponentItemDelegate
JComponentItemDelegate.ChildIterator
ROTATION_CENTER_KEY, scratch, tx
Constructor and Description |
---|
StandaloneDelegate() |
Modifier and Type | Method and Description |
---|---|
void |
addObject(javax.swing.JComponent parent,
javax.swing.JComponent newChild,
java.awt.geom.Rectangle2D newBounds)
Adds the child into the given parent (which must be a container) at the given bounds, relative to the parent.
|
void |
copyMove(java.util.List<javax.swing.JComponent> objects,
double dX,
double dY) |
java.util.Iterator<? extends javax.swing.JComponent> |
findChildren(javax.swing.JComponent container)
Returns an iterator that iterates through the children of the given container in decreasing Z-order (highest
layer
to lowest layer)
|
protected void |
findHits(java.util.LinkedList<javax.swing.JComponent> hits,
javax.swing.JPanel container,
int x,
int y) |
java.util.List<javax.swing.JComponent> |
findObjectsAt(DesignableContainer container,
java.awt.Point point)
Performs a basic "hit-test" to find objects in a container underneath a point.
|
int |
getChildCount(javax.swing.JComponent container)
Returns the count of the number of items currently held in the given container
|
javax.swing.JComponent |
getParent(javax.swing.JComponent child)
Finds the given item's parent in the container hierarchy
|
boolean |
isContainer(javax.swing.JComponent item)
Determines whether any given object is a container.
|
boolean |
isLocked(javax.swing.JComponent item)
Returns whether a normally movable object is currently locked or not
|
boolean |
isMovable(javax.swing.JComponent item)
Defines whether or not an item is inherently movable or not.
|
boolean |
isOffsettingParent(javax.swing.JComponent container)
Tests whether this container is an offsetting parent or not
|
boolean |
isRotateCapable(javax.swing.JComponent item)
Returns whether or not an item supports being rotated.
|
void |
moveObject(javax.swing.JComponent object,
java.awt.geom.Point2D newLocation)
Move the given item to the new location.
|
void |
notifyObjectsMoved(java.util.List<javax.swing.JComponent> objects,
java.util.Map<javax.swing.JComponent,java.awt.geom.Rectangle2D> originalPositions) |
void |
notifyObjectsRotated(java.util.List<javax.swing.JComponent> objects,
double angle,
java.awt.geom.Point2D rotationAnchor) |
void |
rotateObject(javax.swing.JComponent object,
double angle,
java.awt.geom.Point2D rotationAnchor)
Rotate the object around the given point by the angle specified.
|
void |
scaleObject(javax.swing.JComponent object,
java.awt.geom.Rectangle2D newBounds)
Scale the given item to the new bounds.
|
void |
setZOrderPosition(javax.swing.JComponent item,
int position) |
convertRect, convertShape, getBounds, getName, getOffsettingParent, getRotationAnchor, getShapeBounds, initRect, setRotationAnchor
public boolean isMovable(javax.swing.JComponent item)
DesignableDelegate
public boolean isLocked(javax.swing.JComponent item)
DesignableDelegate
public boolean isContainer(javax.swing.JComponent item)
DesignableDelegate
item
- The item to testpublic boolean isOffsettingParent(javax.swing.JComponent container)
DesignableDelegate
public boolean isRotateCapable(javax.swing.JComponent item)
DesignableDelegate
public java.util.List<javax.swing.JComponent> findObjectsAt(DesignableContainer container, java.awt.Point point)
DesignableDelegate
point
- The point in question, relative to the DesignableContainerprotected void findHits(java.util.LinkedList<javax.swing.JComponent> hits, javax.swing.JPanel container, int x, int y)
public java.util.Iterator<? extends javax.swing.JComponent> findChildren(javax.swing.JComponent container)
DesignableDelegate
findChildren
in interface DesignableDelegate
findChildren
in class JComponentItemDelegate
public int getChildCount(javax.swing.JComponent container)
DesignableDelegate
getChildCount
in interface DesignableDelegate
getChildCount
in class JComponentItemDelegate
public javax.swing.JComponent getParent(javax.swing.JComponent child)
DesignableDelegate
public void moveObject(javax.swing.JComponent object, java.awt.geom.Point2D newLocation)
DesignableDelegate
public void scaleObject(javax.swing.JComponent object, java.awt.geom.Rectangle2D newBounds)
DesignableDelegate
public void setZOrderPosition(javax.swing.JComponent item, int position)
public void notifyObjectsMoved(java.util.List<javax.swing.JComponent> objects, java.util.Map<javax.swing.JComponent,java.awt.geom.Rectangle2D> originalPositions)
public void copyMove(java.util.List<javax.swing.JComponent> objects, double dX, double dY)
public void rotateObject(javax.swing.JComponent object, double angle, java.awt.geom.Point2D rotationAnchor)
DesignableDelegate
object
- The object to rotate.angle
- The angle to rotate, specified in radians.rotationAnchor
- The rotation center, relative to the object's parent.public void notifyObjectsRotated(java.util.List<javax.swing.JComponent> objects, double angle, java.awt.geom.Point2D rotationAnchor)
public void addObject(javax.swing.JComponent parent, javax.swing.JComponent newChild, java.awt.geom.Rectangle2D newBounds)
DesignableDelegate