cz.cuni.pogamut.shed.widget
Class ShedScene

Package class diagram package ShedScene
java.lang.Object
  extended by org.netbeans.api.visual.widget.Widget
      extended by org.netbeans.api.visual.widget.Scene
          extended by cz.cuni.pogamut.shed.widget.ShedScene
All Implemented Interfaces:
Accessible

public class ShedScene
extends org.netbeans.api.visual.widget.Scene

Scene that shows the graph representation of lap tree. By itself it is (nearly) only view. ShedPresenter is responsible for manipulating the scene.

Author:
HonzaH
See Also:
factory to instantiate this scene.

Nested Class Summary
 
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
ShedScene(PoshPlan plan)
          Create initial visual configuration and set the presenter.
 
Method Summary
 void addArrow(org.netbeans.api.visual.anchor.Anchor sourceAnchor, org.netbeans.api.visual.anchor.Anchor targetAnchor)
          Create new arrow with specified anchors and add it the connection layer.
 void addArrows(Set<ArrowWidget> arrows)
          Add arrows to connection layer.
 Set<ArrowWidget> findArrows(org.netbeans.api.visual.anchor.Anchor sourceAnchor, org.netbeans.api.visual.anchor.Anchor targetAnchor)
          Find all arrows in the connectionLayer that have specified sourceAnchor and targetAnchor.
 List<org.netbeans.api.visual.widget.Widget> findArrows(org.netbeans.api.visual.widget.Widget arrowEndpointWidget)
          Find all arrows in the scene that have one of anchors attached to the
 ShedWidget findShedWidget(Point scenePoint)
          Find the ShedWidget int the widget layer that contains the passed point.
 ShedDrivesEnvelope getDrivesEnvelope()
           
 ShedTriggerEnvelope getGoalEnvelope()
          Get envelope for the goal of the drive collection.
 IPaletteActions getPaletteActions()
           
 ShedPresenter getPresenter()
          Get presenter used by this scene.
 org.netbeans.api.visual.anchor.Anchor getRootAnchor()
          Get anchor for DC, it is used by goal of DC and drives.
 ShedWidgetFactory getWidgetFactory()
           
protected  void paintChildren()
           
 void removeArrows(Set<ArrowWidget> arrowsToRemove)
          Remove all @arrowsToRemove from the connection layer.
 void removeBranch(org.netbeans.api.visual.widget.Widget removedBranchRoot)
          Method for removing branches from the shed scene.
 void setPaletteActions(IPaletteActions paletteActions)
           
 void setWidgetFactory(ShedWidgetFactory newWidgetFactory)
          Set the factory for creation of widgets, it is not really used by the scene, but presenters need it and this looks like a reasonable plance
 void update()
          Method that revalidates all widgets in @widgetLayer and reroutes all arrows.
 
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, 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

ShedScene

public ShedScene(PoshPlan plan)
Create initial visual configuration and set the presenter. This does not draw the plan! Making sure that view (the scene) is correctly displaying the model is responsibility of presenter.

Parameters:
plan - initial.
Method Detail

getPresenter

public ShedPresenter getPresenter()
Get presenter used by this scene.

Returns:
the presenter of the scene.

getGoalEnvelope

public ShedTriggerEnvelope getGoalEnvelope()
Get envelope for the goal of the drive collection.

Returns:
Envelope for goal senses of DC.

getDrivesEnvelope

public ShedDrivesEnvelope getDrivesEnvelope()
Returns:
Envelope with widgets representations of all drives in the plan.

getRootAnchor

public org.netbeans.api.visual.anchor.Anchor getRootAnchor()
Get anchor for DC, it is used by goal of DC and drives.


setPaletteActions

public void setPaletteActions(IPaletteActions paletteActions)

getPaletteActions

public IPaletteActions getPaletteActions()

removeBranch

public final void removeBranch(org.netbeans.api.visual.widget.Widget removedBranchRoot)
Method for removing branches from the shed scene.

Parameters:
removedBranchRoot -

findArrows

public List<org.netbeans.api.visual.widget.Widget> findArrows(org.netbeans.api.visual.widget.Widget arrowEndpointWidget)
Find all arrows in the scene that have one of anchors attached to the

Parameters:
arrowEndpointWidget - Widget that is used for anchor of each returned arrow.
Returns:
Set of found arrows

findShedWidget

public ShedWidget findShedWidget(Point scenePoint)
Find the ShedWidget int the widget layer that contains the passed point.

Parameters:
scenePoint - Point in the scene coordinated that we are looking for.
Returns:
Found widget or null if not found.

addArrow

public final void addArrow(org.netbeans.api.visual.anchor.Anchor sourceAnchor,
                           org.netbeans.api.visual.anchor.Anchor targetAnchor)
Create new arrow with specified anchors and add it the connection layer. Layer is using anchors and they have to be added to the scene before the scene is validated. IMPORTANT: I can't validate, until the anchors are added to the scene, otherwise not possible to determine location of anchor.

Parameters:
sourceAnchor -
targetAnchor -

addArrows

public void addArrows(Set<ArrowWidget> arrows)
Add arrows to connection layer.

Parameters:
arrows - Arrows to be added

findArrows

public Set<ArrowWidget> findArrows(org.netbeans.api.visual.anchor.Anchor sourceAnchor,
                                   org.netbeans.api.visual.anchor.Anchor targetAnchor)
Find all arrows in the connectionLayer that have specified sourceAnchor and targetAnchor.

Parameters:
sourceAnchor - Source anchor of arrows we are looking for.
targetAnchor - Target anchor of arrows we are looking for.
Returns:
Set of found arrows with desired anchors.

removeArrows

public void removeArrows(Set<ArrowWidget> arrowsToRemove)
Remove all @arrowsToRemove from the connection layer. Do not update scene.

Parameters:
arrowsToRemove -

update

public void update()
Method that revalidates all widgets in @widgetLayer and reroutes all arrows.


paintChildren

protected void paintChildren()
Overrides:
paintChildren in class org.netbeans.api.visual.widget.Widget

getWidgetFactory

public ShedWidgetFactory getWidgetFactory()
Returns:
Widget factory for creating widgets representing other parts of the plan.

setWidgetFactory

public void setWidgetFactory(ShedWidgetFactory newWidgetFactory)
Set the factory for creation of widgets, it is not really used by the scene, but presenters need it and this looks like a reasonable plance

Parameters:
newWidgetFactory - New factory for creation of widgets


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