cz.cuni.pogamut.shed.widget
Class ShedWidgetFactory

Package class diagram package ShedWidgetFactory
java.lang.Object
  extended by cz.cuni.pogamut.shed.widget.ShedWidgetFactory

public class ShedWidgetFactory
extends Object

Factory for creating various shed widgets.

Author:
HonzaH

Field Summary
protected static int HORIZONTAL_GAP
          Horizontal gap between widgets, generally also right padding of widget envelope
protected static int VERTICAL_GAP
          Vertical gap between widgets, generally also bottom padding of widget envelope
 
Method Summary
 ShedCreationContainer<AttachmentEnvelope> createAttachmentEnvelope(LapPath actionPath, TriggeredAction action, LapChain chain)
          Create proper attachment widget for the action and return it.
 ShedCreationContainer<ExpandedActionEnvelope> createdExpandedActionEnvelope(LapPath actionPath, TriggeredAction action, LapChain chain)
          Create envelope containing expanded @action.
 ShedCreationContainer<ShedDriveEnvelope> createDriveEnvelope(LapPath drivePath, DriveElement drive)
          Create envelope containing fully expanded drive along with all inside widgets and presenters.
 ShedCollapseWidget createDriveWidget(LapPath drivePath, DriveElement drive)
          Create drive widget along with its DrivePresenter, only the widget representing the DriveElement, not its Trigger or TriggeredAction
 ShedCreationContainer<ShedChoiceEnvelope> createChoiceEnvelope(LapPath choicePath, CompetenceElement choice, org.netbeans.api.visual.anchor.Anchor sourceAnchor, LapChain competenceChain)
          Create envelope with fully expanded choice along with all inside widgets and presenters.
 ShedCollapseWidget createChoiceWidget(LapPath choicePath, CompetenceElement choice)
          Create choice widget along with its ChoicePresenter, only the widget representing the CompetenceElement, not its Trigger or TriggeredAction
 ShedSenseWidget createSenseWidget(LapPath sensePath, Sense sense, LapChain parentChain)
          Create a widget representing the sense and the presenter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HORIZONTAL_GAP

protected static final int HORIZONTAL_GAP
Horizontal gap between widgets, generally also right padding of widget envelope

See Also:
Constant Field Values

VERTICAL_GAP

protected static final int VERTICAL_GAP
Vertical gap between widgets, generally also bottom padding of widget envelope

See Also:
Constant Field Values
Method Detail

createSenseWidget

public ShedSenseWidget createSenseWidget(LapPath sensePath,
                                         Sense sense,
                                         LapChain parentChain)
Create a widget representing the sense and the presenter. Register presenter.

Parameters:
sensePath - Path to the sense.
sense - Sense the widget will represent
Returns:
Newly created widget

createAttachmentEnvelope

public ShedCreationContainer<AttachmentEnvelope> createAttachmentEnvelope(LapPath actionPath,
                                                                          TriggeredAction action,
                                                                          LapChain chain)
Create proper attachment widget for the action and return it. The created attachment is complete (i.e. all references are expanded).

Parameters:
actionPath - Path to the @action, ends with ../A:?
action - Action for which to create attachment. Must be part of the lap tree.
chain - Chain of parameters from the root up to but not including action.

createDriveWidget

public ShedCollapseWidget createDriveWidget(LapPath drivePath,
                                            DriveElement drive)
Create drive widget along with its DrivePresenter, only the widget representing the DriveElement, not its Trigger or TriggeredAction

Parameters:
drivePath - Path tot the @drive.
drive - drive the widget will represent (will listen on name changes and others)
Returns:
newly created widget representing the DriveElement in the ShedScene.

createChoiceWidget

public ShedCollapseWidget createChoiceWidget(LapPath choicePath,
                                             CompetenceElement choice)
Create choice widget along with its ChoicePresenter, only the widget representing the CompetenceElement, not its Trigger or TriggeredAction

Parameters:
choice - drive the widget will represent (will listen on name changes and others)
Returns:
newly created widget representing the DriveElement in the ShedScene.

createdExpandedActionEnvelope

public ShedCreationContainer<ExpandedActionEnvelope> createdExpandedActionEnvelope(LapPath actionPath,
                                                                                   TriggeredAction action,
                                                                                   LapChain chain)
Create envelope containing expanded @action.

Parameters:
actionPath - Path to the @action, ends with ../A:?
action - Action that will be expanded
chain - Chain of parameters up to but not including the action.
Returns:
created envelope.

createDriveEnvelope

public ShedCreationContainer<ShedDriveEnvelope> createDriveEnvelope(LapPath drivePath,
                                                                    DriveElement drive)
Create envelope containing fully expanded drive along with all inside widgets and presenters.

Parameters:
scene - Scene into which the widget belongs to.
drive - Drive that will be used to create the envelope and all elements inside.
Returns:
Newly created envelope for the drive

createChoiceEnvelope

public ShedCreationContainer<ShedChoiceEnvelope> createChoiceEnvelope(LapPath choicePath,
                                                                      CompetenceElement choice,
                                                                      org.netbeans.api.visual.anchor.Anchor sourceAnchor,
                                                                      LapChain competenceChain)
Create envelope with fully expanded choice along with all inside widgets and presenters. The presenters are already registered.

Parameters:
choicePath - Path to the @choice
choice - CompetenceElement used to create the expanded envelope
sourceAnchor - Source anchor for ArrowWidget between the expanded choice widget and its parent.
competenceChain - Chain of parameters from root up to incl. competence.
Returns:
Created visual representation.


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