|
org.netbeans.api.visual 2.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.api.visual.anchor.Anchor
public abstract class Anchor
This class represents an anchor for connections. An anchor is usually attached to widget and resolves a source or target point of a connection where it is used. Single instance of an anchor could be used by multiple entries. An entry represents the place where the anchor is used. An anchor can by attached to so-called proxy-anchor also. The proxy-anchor uses a set of anchor and allows smooth switching of the active anchor.
Nested Class Summary | |
---|---|
static class |
Anchor.Direction
The direction of the anchor. |
static interface |
Anchor.Entry
Represents a place where an anchor is used. |
class |
Anchor.Result
Represents calculated scene location and orthogonal direction(s) of an anchor. |
Field Summary | |
---|---|
static EnumSet<Anchor.Direction> |
DIRECTION_ANY
The set of all orthogonal directions. |
Constructor Summary | |
---|---|
protected |
Anchor(Widget relatedWidget)
Creates an anchor that is related to a widget. |
Method Summary | |
---|---|
void |
addEntries(List<Anchor.Entry> entries)
Registers multiple entries at once. |
void |
addEntry(Anchor.Entry entry)
Called by ConnectionWidget to register the usage of the anchor. |
abstract Anchor.Result |
compute(Anchor.Entry entry)
Computes a result (position and direction) for a specific entry. |
List<Anchor.Entry> |
getEntries()
Returns a list of registered entries |
Point |
getOppositeSceneLocation(Anchor.Entry entry)
Returns a scene location of a related widget of an opposite anchor. |
Point |
getRelatedSceneLocation()
Returns a scene location of a related widget. |
Widget |
getRelatedWidget()
Returns a related widget. |
protected boolean |
isUsed()
Returns whether the anchor is used. |
protected void |
notifyEntryAdded(Anchor.Entry entry)
Notifies when an entry is registered |
protected void |
notifyEntryRemoved(Anchor.Entry entry)
Notifies when an entry is unregistered |
protected void |
notifyUnused()
Notifies when the anchor is going to be not used. |
protected void |
notifyUsed()
Notifies when the anchor is going to be used. |
void |
removeEntries(List<Anchor.Entry> entries)
Unregisters multiple entries at once. |
void |
removeEntry(Anchor.Entry entry)
Called by ConnectionWidget to unregister the usage of the anchor. |
void |
revalidateDependency()
This method is called by revalidation-change of related widget and notifies all entries about the anchor change. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final EnumSet<Anchor.Direction> DIRECTION_ANY
Constructor Detail |
---|
protected Anchor(Widget relatedWidget)
relatedWidget
- the related widget; if null then the anchor is not related to any widgetMethod Detail |
---|
public final void addEntry(Anchor.Entry entry)
entry
- the anchor entrypublic final void removeEntry(Anchor.Entry entry)
entry
- the anchor entrypublic final void addEntries(List<Anchor.Entry> entries)
entries
- a list of entriespublic final void removeEntries(List<Anchor.Entry> entries)
entries
- a list of entriespublic final List<Anchor.Entry> getEntries()
protected void notifyEntryAdded(Anchor.Entry entry)
entry
- the registered entryprotected void notifyEntryRemoved(Anchor.Entry entry)
entry
- the unregistered entryprotected final boolean isUsed()
protected void notifyUsed()
protected void notifyUnused()
public final void revalidateDependency()
revalidateDependency
in interface Widget.Dependency
public Widget getRelatedWidget()
public Point getRelatedSceneLocation()
public Point getOppositeSceneLocation(Anchor.Entry entry)
entry
- the entry to which the opposite anchor searched
public abstract Anchor.Result compute(Anchor.Entry entry)
entry
- the entry
|
org.netbeans.api.visual 2.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |