cz.cuni.pogamut.posh.widget
Class PoshScene

Package class diagram package PoshScene
java.lang.Object
  extended by org.netbeans.api.visual.widget.Widget
      extended by org.netbeans.api.visual.widget.Scene
          extended by org.netbeans.api.visual.model.ObjectScene
              extended by org.netbeans.api.visual.graph.GraphScene
                  extended by cz.cuni.pogamut.posh.widget.PoshScene
All Implemented Interfaces:
Accessible

public class PoshScene
extends org.netbeans.api.visual.graph.GraphScene

Scene where all PoshWidgets are placed into.

Use clearPoshWidgets to remove all PoshWidgets and its connections from the scene Set new root widget by setRootWidget and the rest should be handled by root widget that will recieve informations about new children, moved children or about deletions.

How to create:

Author:
Honza Havlicek

Nested Class Summary
 
Nested classes/interfaces inherited from class org.netbeans.api.visual.graph.GraphScene
org.netbeans.api.visual.graph.GraphScene.StringGraph
 
Nested classes/interfaces inherited from class org.netbeans.api.visual.widget.Scene
org.netbeans.api.visual.widget.Scene.SceneListener
 
Nested classes/interfaces inherited from class org.netbeans.api.visual.widget.Widget
org.netbeans.api.visual.widget.Widget.Dependency
 
Constructor Summary
PoshScene()
          Create a new PoshScene, add default Pan and Zoom actions to the scene
 
Method Summary
protected  void addGhostWidget(org.netbeans.api.visual.widget.Widget ghost)
          Add widget to ghost layer, used for DnD
 void addPoshWidget(PoshWidget newWidget, boolean consolidate)
          Add widget and its connection widget to the scene.
protected  void attachEdgeSourceAnchor(Object arg0, Object arg1, Object arg2)
          Not implemented, not usefull.
protected  void attachEdgeTargetAnchor(Object arg0, Object arg1, Object arg2)
          Not implemented, not usefull.
protected  org.netbeans.api.visual.widget.Widget attachEdgeWidget(Object node)
          Called by the addEdge method before the edge is registered to acquire a widget that is going to represent the edge in the scene.
protected  org.netbeans.api.visual.widget.Widget attachNodeWidget(Object node)
          Called by the addNode method before the node is registered to acquire a widget that is going to represent the node in the scene.
 void clearPoshWidgets()
          Clear the scene, remove all widgets from the PoshScene.
 void consolidate()
          Order all widgets to form a tree, root widget is in left top corner.
 void deletePoshWidget(PoshWidget widget)
          Remove widget and its connection from scene, doesn't consolidate BEWARE: if it is not leaf that is removed, results are unpredictable.
 Map<String,String> getActionsFQNMapping()
           
protected  List<org.netbeans.api.visual.widget.Widget> getPoshWidgets()
          Return list of PoshWidgets that are in the main layer.
 PoshWidget<? extends cz.cuni.amis.pogamut.sposh.elements.PoshElement> getRootWidget()
           
 Map<String,String> getSensesFQNMapping()
           
 boolean isInMainLayer(PoshWidget widget)
          Check if the widget is in the main layer.
protected  void removeGhostWidget(org.netbeans.api.visual.widget.Widget ghost)
          Remove the widget from DnD layer
 void setParsingError()
          In case of parsing error, hide all widgets in the scene.
 void setRootWidget(PoshWidget<? extends cz.cuni.amis.pogamut.sposh.elements.PoshElement> node)
          Set root widget of the scene.
 void setSourceUpdater(KidViewElement.SourceUpdater sourceUpdater)
          Source updater will take the lap plan in its current tree form and serializes it into the document form This is set every time I switch from text to graph view XXX: My eyes are bleeding.
 void updateSource()
           
 
Methods inherited from class org.netbeans.api.visual.graph.GraphScene
addEdge, addNode, detachEdgeWidget, detachNodeWidget, findEdgesBetween, findNodeEdges, getEdges, getEdgeSource, getEdgeTarget, getNodes, isEdge, isNode, notifyEdgeAdded, notifyNodeAdded, removeEdge, removeNode, removeNodeWithEdges, setEdgeSource, setEdgeTarget
 
Methods inherited from class org.netbeans.api.visual.model.ObjectScene
addObject, addObjectSceneListener, createObjectHoverAction, createSelectAction, findObject, findStoredObject, findWidget, findWidgets, getFocusedObject, getHighlightedObjects, getHoveredObject, getIdentityCode, getObjects, getObjectState, getSelectedObjects, isObject, removeObject, removeObjectSceneListener, setFocusedObject, setHighlightedObjects, setHoveredObject, setSelectedObjects, userSelectionSuggested
 
Methods inherited from class org.netbeans.api.visual.widget.Scene
addSceneListener, convertSceneToView, convertSceneToView, convertViewToScene, createBirdView, createSatelliteView, createView, createWidgetHoverAction, getActiveTool, getDefaultFont, getFocusedWidget, getGraphics, getInputBindings, getKeyEventProcessingType, getLookFeel, getMaximumBounds, getPriorActions, getResourceTable, getSceneAnimator, getView, getZoomFactor, isRepaintRequiredForRevalidating, isValidated, paint, removeSceneListener, setActiveTool, setFocusedWidget, setKeyEventProcessingType, setLookFeel, setMaximumBounds, setResourceTable, setZoomFactor, validate, validate
 
Methods inherited from class org.netbeans.api.visual.widget.Widget
addChild, addChild, addChild, addChild, addChildren, addDependency, bringToBack, bringToFront, calculateClientArea, convertLocalToScene, convertLocalToScene, convertSceneToLocal, convertSceneToLocal, createActions, equals, getAccessibleContext, getActions, getActions, getBackground, getBorder, getBounds, getChildConstraint, getChildren, getClientArea, getCursor, getCursorAt, getDependencies, getFont, getForeground, getLayout, getLocation, getLookup, getMaximumSize, getMinimumSize, getParentWidget, getPreferredBounds, getPreferredLocation, getPreferredSize, getScene, getState, getToolTipText, hashCode, isCheckClipping, isEnabled, isHitAt, isOpaque, isPreferredBoundsSet, isVisible, notifyAdded, notifyBackgroundChanged, notifyFontChanged, notifyForegroundChanged, notifyRemoved, notifyStateChanged, paint, paintBackground, paintBorder, paintChildren, paintWidget, 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, setState, setToolTipText, setVisible, updateResources
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PoshScene

public PoshScene()
Create a new PoshScene, add default Pan and Zoom actions to the scene

Method Detail

getActionsFQNMapping

public Map<String,String> getActionsFQNMapping()

getSensesFQNMapping

public Map<String,String> getSensesFQNMapping()

clearPoshWidgets

public void clearPoshWidgets()
Clear the scene, remove all widgets from the PoshScene.


isInMainLayer

public boolean isInMainLayer(PoshWidget widget)
Check if the widget is in the main layer.

Parameters:
widget - widget that will be checked.
Returns:
true if widget is in main layer, false else.

setParsingError

public void setParsingError()
In case of parsing error, hide all widgets in the scene. It will be later regenerated from correct source.


consolidate

public void consolidate()
Order all widgets to form a tree, root widget is in left top corner.


deletePoshWidget

public void deletePoshWidget(PoshWidget widget)
Remove widget and its connection from scene, doesn't consolidate BEWARE: if it is not leaf that is removed, results are unpredictable.

Parameters:
widget - widget to delete

getRootWidget

public PoshWidget<? extends cz.cuni.amis.pogamut.sposh.elements.PoshElement> getRootWidget()

setRootWidget

public void setRootWidget(PoshWidget<? extends cz.cuni.amis.pogamut.sposh.elements.PoshElement> node)
Set root widget of the scene. TODO: maybe clearsubtree instead of just widget.

Parameters:
node -

addPoshWidget

public void addPoshWidget(PoshWidget newWidget,
                          boolean consolidate)
Add widget and its connection widget to the scene. Validate it afterwards, consolidate if parameter set.

Parameters:
newWidget - widget that is being added to the tree
consolidate - should the method automaticaly consolidate the tree?

attachNodeWidget

protected org.netbeans.api.visual.widget.Widget attachNodeWidget(Object node)
Called by the addNode method before the node is registered to acquire a widget that is going to represent the node in the scene. The method is responsible for creating the widget, adding it into the scene and returning it from the method. Not implemented, not usefull.

Specified by:
attachNodeWidget in class org.netbeans.api.visual.graph.GraphScene
Parameters:
node - the node that is going to be added
Returns:
the widget representing the node; null, if the node is non-visual

attachEdgeWidget

protected org.netbeans.api.visual.widget.Widget attachEdgeWidget(Object node)
Called by the addEdge method before the edge is registered to acquire a widget that is going to represent the edge in the scene. The method is responsible for creating the widget, adding it into the scene and returning it from the method. Not implemented, not usefull.

Specified by:
attachEdgeWidget in class org.netbeans.api.visual.graph.GraphScene
Parameters:
node - the edge that is going to be added
Returns:
the widget representing the edge; null, if the edge is non-visual

attachEdgeSourceAnchor

protected void attachEdgeSourceAnchor(Object arg0,
                                      Object arg1,
                                      Object arg2)
Not implemented, not usefull.

Specified by:
attachEdgeSourceAnchor in class org.netbeans.api.visual.graph.GraphScene

attachEdgeTargetAnchor

protected void attachEdgeTargetAnchor(Object arg0,
                                      Object arg1,
                                      Object arg2)
Not implemented, not usefull.

Specified by:
attachEdgeTargetAnchor in class org.netbeans.api.visual.graph.GraphScene

addGhostWidget

protected void addGhostWidget(org.netbeans.api.visual.widget.Widget ghost)
Add widget to ghost layer, used for DnD

Parameters:
ghost - Widget to be added to the layer

removeGhostWidget

protected void removeGhostWidget(org.netbeans.api.visual.widget.Widget ghost)
Remove the widget from DnD layer

Parameters:
ghost - widget to be removed from the DnD layer

getPoshWidgets

protected List<org.netbeans.api.visual.widget.Widget> getPoshWidgets()
Return list of PoshWidgets that are in the main layer.

Returns:

setSourceUpdater

public void setSourceUpdater(KidViewElement.SourceUpdater sourceUpdater)
Source updater will take the lap plan in its current tree form and serializes it into the document form This is set every time I switch from text to graph view XXX: My eyes are bleeding. Kill this code with fire.

Parameters:
sourceUpdater -

updateSource

public void updateSource()


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.