public abstract class PoshWidget<T extends cz.cuni.amis.pogamut.sposh.elements.PoshElement>
extends org.netbeans.api.visual.widget.Widget
implements cz.cuni.amis.pogamut.sposh.elements.PoshElementListener, org.netbeans.api.visual.action.PopupMenuProvider
| Modifier and Type | Class and Description |
|---|---|
protected static class |
PoshWidget.PropertyNode
Small class that is used to show properties of element in the properties window.
|
| Modifier and Type | Field and Description |
|---|---|
int |
height |
protected PoshWidget.PropertyNode |
propertyNode |
int |
width |
| Modifier | Constructor and Description |
|---|---|
protected |
PoshWidget(PoshScene scene,
T node,
PoshWidget<? extends cz.cuni.amis.pogamut.sposh.elements.PoshElement> parentWidget,
String displayName)
Create a widget representing PoshElement.
|
| Modifier and Type | Method and Description |
|---|---|
protected Rectangle |
calculateClientArea() |
protected PoshWidget.PropertyNode |
createPropertiesNode() |
protected org.openide.nodes.Sheet |
createSheet()
Create Node.Sheet for poroperties of this widget.
|
protected void |
doRepaint() |
protected abstract void |
elementPropertyChange(PropertyChangeEvent evt)
This is a method that is supposed to handle property changes of the lap
element.
|
protected abstract List<AbstractAcceptAction> |
getAcceptProviders()
Return list of acceptors that will do something when proper
Transferable is dropped on the widget.
|
List<PoshWidget<? extends cz.cuni.amis.pogamut.sposh.elements.PoshElement>> |
getChildNodes()
Get children of this node.
|
String |
getCommentText()
Return text of comment, actual type of PoshElement this
widget represents.
|
org.netbeans.api.visual.widget.ConnectionWidget |
getConnection()
Set ConnectionWidget that connects this PoshWidget to its parent.
|
T |
getDataNode()
Get associated PoshElement
|
String |
getHeadlineText()
Get actual text of headline.
|
PoshWidget<? extends cz.cuni.amis.pogamut.sposh.elements.PoshElement> |
getParent()
Get parent widget
|
abstract JPopupMenu |
getPopupMenu(org.netbeans.api.visual.widget.Widget arg0,
Point arg1)
Return menu associated with the widget (will be used as context menu).
|
PoshScene |
getPoshScene()
Return PoshScene the widget is in.
|
protected org.openide.nodes.Node |
getPropertiesNode()
Return Node that contains properties associated with the widget.
|
PoshWidget<? extends cz.cuni.amis.pogamut.sposh.elements.PoshElement> |
getRootWidget()
Get root widget of the tree this widget belongs to.
|
protected abstract PoshNodeType |
getType()
Get type of widget, in this case type of PoshElement
|
boolean |
isAncestor(PoshWidget ancestorWidget)
Is passed ancestorWidget in path from this widget to the root?
|
boolean |
isCollapsed()
Is this node collapsed (children won't be seen)
|
protected void |
paintWidget() |
void |
propertyChange(PropertyChangeEvent evt)
Listener for changes of node properties (e.g.
|
void |
select(org.netbeans.api.visual.widget.Widget arg0,
Point arg1,
boolean arg2)
What should I do if I am selected(=left clicked)?
In this case, change Properties widow to properties of associated DataNode
|
void |
setCollapsed(boolean newCollapsedState)
Collapse or uncollapse the tree
|
protected void |
setCommentText(String text) |
void |
setHeadlineText(String text)
Set text that should appear in headline.
|
String |
toString() |
protected void |
updateSources()
Update sources according to the state of the lap tree.
|
addChild, addChild, addChild, addChild, addChildren, addDependency, bringToBack, bringToFront, convertLocalToScene, convertLocalToScene, convertSceneToLocal, convertSceneToLocal, createActions, equals, getAccessibleContext, getActions, getActions, getBackground, getBorder, getBounds, getChildConstraint, getChildren, getClientArea, getCursor, getCursorAt, getDependencies, getFont, getForeground, getGraphics, getLayout, getLocation, getLookup, getMaximumSize, getMinimumSize, getParentWidget, getPreferredBounds, getPreferredLocation, getPreferredSize, getResourceTable, getScene, getState, getToolTipText, hashCode, isCheckClipping, isEnabled, isHitAt, isOpaque, isPreferredBoundsSet, isRepaintRequiredForRevalidating, isValidated, isVisible, notifyAdded, notifyBackgroundChanged, notifyFontChanged, notifyForegroundChanged, notifyRemoved, notifyStateChanged, paint, paintBackground, paintBorder, paintChildren, removeChild, removeChildren, removeChildren, removeDependency, removeFromParent, repaint, resolveBounds, revalidate, revalidate, setAccessibleContext, setBackground, setBackgroundFromResource, setBorder, setBorder, setCheckClipping, setChildConstraint, setCursor, setEnabled, setFont, setFontFromResource, setForeground, setForegroundFromResource, setLayout, setMaximumSize, setMinimumSize, setOpaque, setPreferredBounds, setPreferredLocation, setPreferredSize, setResourceTable, setState, setToolTipText, setVisible, updateResourcesprotected PoshWidget.PropertyNode propertyNode
public final int width
public final int height
protected PoshWidget(PoshScene scene, T node, PoshWidget<? extends cz.cuni.amis.pogamut.sposh.elements.PoshElement> parentWidget, String displayName)
scene - node - associated data node of this widget. never null.parentWidget - Parent widget of this widget (parent node), can be null,
if it is root of tree representation of POSH plan.public final void propertyChange(PropertyChangeEvent evt)
elementPropertyChange(java.beans.PropertyChangeEvent) instead.propertyChange in interface PropertyChangeListenerevt - description of a change in the nodeprotected abstract void elementPropertyChange(PropertyChangeEvent evt)
evt - description of changeprotected final void updateSources()
public final PoshWidget<? extends cz.cuni.amis.pogamut.sposh.elements.PoshElement> getRootWidget()
PoshPlan.public final List<PoshWidget<? extends cz.cuni.amis.pogamut.sposh.elements.PoshElement>> getChildNodes()
public String getHeadlineText()
public String getCommentText()
protected final void setCommentText(String text)
public boolean isAncestor(PoshWidget ancestorWidget)
ancestorWidget - widget thatpublic final void setHeadlineText(String text)
text - Text that should be shown in headlineprotected abstract List<AbstractAcceptAction> getAcceptProviders()
protected abstract PoshNodeType getType()
public abstract JPopupMenu getPopupMenu(org.netbeans.api.visual.widget.Widget arg0, Point arg1)
getPopupMenu in interface org.netbeans.api.visual.action.PopupMenuProviderarg0 - ignoredarg1 - ignoredpublic T getDataNode()
public PoshScene getPoshScene()
public PoshWidget<? extends cz.cuni.amis.pogamut.sposh.elements.PoshElement> getParent()
protected org.openide.nodes.Sheet createSheet()
protected final org.openide.nodes.Node getPropertiesNode()
protected PoshWidget.PropertyNode createPropertiesNode()
public void select(org.netbeans.api.visual.widget.Widget arg0,
Point arg1,
boolean arg2)
public final org.netbeans.api.visual.widget.ConnectionWidget getConnection()
public boolean isCollapsed()
public void setCollapsed(boolean newCollapsedState)
protected void doRepaint()
protected Rectangle calculateClientArea()
calculateClientArea in class org.netbeans.api.visual.widget.Widgetprotected void paintWidget()
paintWidget in class org.netbeans.api.visual.widget.WidgetCopyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.