|
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.widget.Widget
org.netbeans.api.visual.vmd.VMDNodeWidget
public class VMDNodeWidget
This class represents a node widget in the VMD visualization style. It implements the minimize ability.
It allows to add pin widgets into the widget using attachPinWidget
method.
The node widget consists of a header (with an image, a name, secondary name and a glyph set) and the content.
The content contains pin widgets. Pin widgets can be organized in pin-categories defined by calling sortPins
method.
The sortPins
method has to be called refresh the order after adding a pin widget.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.netbeans.api.visual.widget.Widget |
---|
Widget.Dependency |
Constructor Summary | |
---|---|
VMDNodeWidget(Scene scene)
Creates a node widget. |
Method Summary | |
---|---|
void |
attachPinWidget(Widget widget)
Attaches a pin widget to the node widget. |
void |
collapseWidget()
Collapses the widget. |
Anchor |
createAnchorPin(Anchor anchor)
Creates an extended pin anchor with an ability of reconnecting to the node anchor when the node is minimized. |
void |
expandWidget()
Expands the widget. |
Widget |
getHeader()
Returns a header widget. |
Anchor |
getNodeAnchor()
Returns a node anchor. |
String |
getNodeName()
Returns a node name. |
LabelWidget |
getNodeNameWidget()
Returns a node name widget. |
protected boolean |
isMinimizableWidget(Widget widget)
Called to check whether a particular widget is minimizable. |
boolean |
isMinimized()
Check the minimized state. |
protected void |
notifyStateChanged(ObjectState previousState,
ObjectState state)
Called to notify about the change of the widget state. |
void |
setGlyphs(List<Image> glyphs)
Sets node glyphs. |
void |
setMinimized(boolean minimized)
Set the minimized state. |
void |
setNodeImage(Image image)
Sets a node image. |
void |
setNodeName(String nodeName)
Sets a node name. |
void |
setNodeProperties(Image image,
String nodeName,
String nodeType,
List<Image> glyphs)
Sets all node properties at once. |
void |
setNodeType(String nodeType)
Sets a node type (secondary name). |
void |
sortPins(HashMap<String,List<Widget>> pinsCategories)
Sorts and assigns pins into categories. |
void |
stateChanged()
Called when a minimized state is changed. |
void |
toggleMinimized()
Toggles the minimized state. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VMDNodeWidget(Scene scene)
scene
- the sceneMethod Detail |
---|
protected boolean isMinimizableWidget(Widget widget)
VMDNodeWidget.createPinAnchor
is not affected by this method.
widget
- the widget
public boolean isMinimized()
public void setMinimized(boolean minimized)
minimized
- if true, then the widget is going to be minimizedpublic void toggleMinimized()
public void stateChanged()
stateChanged
in interface StateModel.Listener
protected void notifyStateChanged(ObjectState previousState, ObjectState state)
notifyStateChanged
in class Widget
previousState
- the previous statestate
- the new statepublic void setNodeImage(Image image)
image
- the imagepublic String getNodeName()
public void setNodeName(String nodeName)
nodeName
- the node namepublic void setNodeType(String nodeType)
nodeType
- the node typepublic void attachPinWidget(Widget widget)
widget
- the pin widgetpublic void setGlyphs(List<Image> glyphs)
glyphs
- the list of imagespublic void setNodeProperties(Image image, String nodeName, String nodeType, List<Image> glyphs)
image
- the node imagenodeName
- the node namenodeType
- the node type (secondary name)glyphs
- the node glyphspublic LabelWidget getNodeNameWidget()
public Anchor getNodeAnchor()
public Anchor createAnchorPin(Anchor anchor)
anchor
- the original pin anchor from which the extended anchor is created
public void sortPins(HashMap<String,List<Widget>> pinsCategories)
pinsCategories
- the map of category name as key and a list of pin widgets as valuepublic void collapseWidget()
collapseWidget
in interface VMDMinimizeAbility
public void expandWidget()
expandWidget
in interface VMDMinimizeAbility
public Widget getHeader()
|
org.netbeans.api.visual 2.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |