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)
          IMPORTANT: I can't validate, until the parent is added to the scene.
 void addArrows(Set<ArrowWidget> arrows)
           
 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.
 ShedPresenter getPresenter()
          Get presenter used by this scene.
 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 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
addDependency, addChild, addChild, addChild, addChild, addChildren, bringToBack, bringToFront, calculateClientArea, convertLocalToScene, convertLocalToScene, convertSceneToLocal, convertSceneToLocal, createActions, equals, getAccessibleContext, getActions, getActions, getBackground, getBorder, getBounds, getClientArea, getCursor, getCursorAt, getDependencies, getFont, getForeground, getChildConstraint, getChildren, getLayout, getLocation, getLookup, getMaximumSize, getMinimumSize, getParentWidget, getPreferredBounds, getPreferredLocation, getPreferredSize, getScene, getState, getToolTipText, hashCode, isEnabled, isHitAt, isCheckClipping, isOpaque, isPreferredBoundsSet, isVisible, notifyAdded, notifyBackgroundChanged, notifyFontChanged, notifyForegroundChanged, notifyRemoved, notifyStateChanged, paint, paintBackground, paintBorder, paintWidget, removeDependency, removeFromParent, removeChild, removeChildren, removeChildren, repaint, resolveBounds, revalidate, revalidate, setAccessibleContext, setBackground, setBackgroundFromResource, setBorder, setBorder, setCursor, setEnabled, setFont, setFontFromResource, setForeground, setForegroundFromResource, setCheckClipping, setChildConstraint, 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.

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)
IMPORTANT: I can't validate, until the parent is added to the scene.

Parameters:
sourceAnchor -
targetAnchor -

addArrows

public void addArrows(Set<ArrowWidget> arrows)

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.


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