Classes | Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation Class Reference

List of all members.

Classes

enum  HighlightType

Public Member Functions

 ActionDrawInformation (Action parent)
Action checkClick (float x, float y)
Action checkClickExpand (float x, float y)
ActionDrawInformation checkHover (float x, float y, ActionDrawInformation found)
Action checkPosOverInboundConnector (float mouse_x, float mouse_y)
Action checkPosOverOutboundConnector (float mouse_x, float mouse_y)
void clearHightlight ()
void drawExtendedBox (PApplet applet, Vector2f position, Vector2f drawOffset)
void drawSimpleBox (PApplet applet, Vector2f position, Vector2f drawOffset, float minHeight)
void drawSimpleBox (PApplet applet, Vector2f position, Vector2f drawOffset, float minHeight, boolean drawExpandBox)
Rectangle getBoundingBox ()
Vector2f getExtendedBoxDimension ()
HighlightType getHighlight ()
Vector2f getInboundConnectorPos ()
float getNameBoxHeight ()
float getNameWidth ()
Vector2f getOutboundConnectorPos ()
Vector2f getSimpleBoxDimension ()
float getTextHeight ()
boolean highlightSubsequence (String identifier, boolean expand)
boolean highlightSubsequence (Action seq, boolean expand)
boolean IsHover ()
void notifyModified ()
void recalculateDimensions (PApplet applet)
void setHightlight (HighlightType h)
boolean updateHover (float x, float y)

Public Attributes

Vector2f globalPosOffset
Vector2f localPosOffset
Vector2f position

Static Public Attributes

static final Vector2f CONNECTOR_DIM = new Vector2f(50f, 7f)
static final float EXPAND_BOX_HEIGHT = 18f
static final float INNER_CONTENT_PADDING = 10f
static final float LINE_HEIGHT = 1.5f
static final float MAIN_BOX_PADDING = 15f
static final float SEQUENCE_BOX_PADDING = 10f

Private Member Functions

ActionDrawInformation checkHoverExpand (float mouse_x, float mouse_y, boolean hasExpandButton, float sequenceBoxHeight, boolean parentExpanded)
ActionDrawInformation checkHoverExtendedSequence (float x, float y, Action currAction, ActionDrawInformation found)
void drawBorderAndTitle (PApplet applet, Vector2f position, Vector2f dimension)
void drawProperties (PApplet applet, Vector2f position)
void drawSequence (PApplet applet, Vector2f position, Vector2f drawOffset, boolean isExpandedBox)
void notifyModifiedSubsequences (Action a)
void setHover (boolean hover)
void setHoverExpand (boolean hover)

Static Private Member Functions

static void checkAndAddSizeOfExpandedSequence (PApplet applet, Vector2f currentSequenceBoxSize, Action currAction)

Private Attributes

Action action
Rectangle boundingBoxExtended = new Rectangle(0,0,0,0)
Rectangle boundingBoxSimple = new Rectangle(0,0,0,0)
float boxOffsetLeft
Color currentBackgroundBrightColor = backgroundBrightColor
Color currentBackgroundColor = backgroundColor
Color currentBorderColor = borderColor
Color currentExpandBackgroundColor = arrowExpandBackgroundColor
Color currentExpandBorderColor = arrowExpandBorderColor
Color currentTextColor = textColor
boolean drawnAsSimple
boolean hasExpandButton = false
HighlightType highlight = HighlightType.NOT_HIGHTLIGHTED
boolean isHover = false
float maxKeyWidth
float maxSubsequenceHeight = 0
float maxValueWidth
float nameWidth
boolean needsRecalculation = true
float propertiesHeight
Vector2f sequenceBoxDimension = new Vector2f()
float textHeight

Static Private Attributes

static final Color arrowBackgroundColor = new Color(51,105,192,230)
static final Color arrowBorderColor = new Color(27, 56, 102)
static final Color arrowExpandBackgroundColor = new Color(125,67,67,230)
static final Color arrowExpandBorderColor = new Color(94, 61, 61)
static final Color backgroundBrightColor = new Color(50,50,50)
static final Color backgroundColor = new Color(30,30,30)
static final Color borderColor = new Color(100, 100, 100)
static final float currentStroke = 1.5f
static final float defaultStroke = 1f
static final Color highlightBorderColor = new Color(103,134,85)
static final Color highlightBrightBorderColor = new Color(167,217,137)
static final Color hoverArrowExpandBackgroundColor = new Color(190,141,141,230)
static final Color hoverArrowExpandBorderColor = new Color(190, 123, 123)
static final Color hoverBackgroundBrightColor = new Color(100,100,100)
static final Color hoverBackgroundColor = new Color(60,60,60)
static final Color hoverBorderColor = new Color(200, 200, 200)
static final Color hoverTextColor = new Color(255,255,255)
static final Color textColor = new Color(240,240,240)

Detailed Description

This class is used in an Action class for saving parameters used during draw of the action. For example this stores the position/size of the action box.

There are two different drawing types:

Author:
Stefan Profanter
See also:
edu.tum.cs.ias.knowrob.vis.actions.Action

Definition at line 28 of file ActionDrawInformation.java.


Constructor & Destructor Documentation

Constructor

Parameters:
parentParent action for which this draw infos are

Definition at line 301 of file ActionDrawInformation.java.


Member Function Documentation

static void edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.checkAndAddSizeOfExpandedSequence ( PApplet  applet,
Vector2f  currentSequenceBoxSize,
Action  currAction 
) [inline, static, private]

Needed for calculating the total size of the sequence box. Adds the size of an expanded box to the current calculated size

Parameters:
appletApplet to draw on
currentSequenceBoxSizecurrently calculated size. If a child-sequence is expanded then it's size will be added to this.
currActioncurrent action for which the subsequences should be checked

Definition at line 388 of file ActionDrawInformation.java.

Check if mouse click on position x|y was intended for an action.

Parameters:
xx coordinate of mouse
yy coordinate of mouse
Returns:
Action which is under given coordinate of null if none

Definition at line 1133 of file ActionDrawInformation.java.

Check if mouse click on position x|y was intended for an expand button.

Parameters:
xx coordinate of mouse
yy coordinate of mouse
Returns:
Action for which this expand button is

Definition at line 1148 of file ActionDrawInformation.java.

Check if mouse position x|y is over this action

Parameters:
xx coordinate of mouse
yy coordinate of mouse
foundInParentset to true if aleady a matching box was found, so only setHover(false) is needed to call
Returns:
the Action (its draw info) over which the mouse is hovering or null if none.

Definition at line 926 of file ActionDrawInformation.java.

ActionDrawInformation edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.checkHoverExpand ( float  mouse_x,
float  mouse_y,
boolean  hasExpandButton,
float  sequenceBoxHeight,
boolean  parentExpanded 
) [inline, private]

Check if mouse position x|y is over an expand arrow

Parameters:
mouse_xx coordinate of mouse
mouse_yy coordinate of mouse
sequenceExpandHeightset to 0 for direct call. Only used for recursing
Returns:
the parent Action (it's draw info) over which's expand arrow the mouse is hovering or null if none.

Definition at line 1019 of file ActionDrawInformation.java.

Check if x|y coordinate is on a currently visible subsequence (also expanded ones)

Parameters:
xx coordinate
yy coordinate
currActioncurrent action to check
foundset to an action if already one action found and the others only need to be resetted.
Returns:
the action where the coordinate is on

Definition at line 894 of file ActionDrawInformation.java.

Check if mouse position is inside inbound connector

Parameters:
mouse_xx coordinate of mouse
mouse_yy coordinate of mouse
Returns:
This action (if connector was clicked on), or null if none.

Definition at line 1077 of file ActionDrawInformation.java.

Check if mouse position is inside outbound connector

Parameters:
mouse_xx coordinate of mouse
mouse_yy coordinate of mouse
Returns:
This action (if connector was clicked on), or null if none.

Definition at line 1099 of file ActionDrawInformation.java.

Clear the highlight status of the action (set it to NOT_HIGHLIGHTED). Also clear the hightlight on all the children.

Definition at line 1210 of file ActionDrawInformation.java.

void edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.drawBorderAndTitle ( PApplet  applet,
Vector2f  position,
Vector2f  dimension 
) [inline, private]

Draw border and title of the action with given dimension at given position

Parameters:
appletApplet to draw on
positionposition where to draw the box
dimensiondimension of the box to draw

Definition at line 519 of file ActionDrawInformation.java.

void edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.drawExtendedBox ( PApplet  applet,
Vector2f  position,
Vector2f  drawOffset 
) [inline]

Draw the extended action box which contains properties and subsequences. Also parent and child actions will be drawn.

Parameters:
appletApplet to draw on.
positionUpper left corner where to begin to draw. If the action has parent action(s) it will be the position of the first parent box. If none parent actions are present, this will be the upper left corner of the extended box.

Definition at line 800 of file ActionDrawInformation.java.

void edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.drawProperties ( PApplet  applet,
Vector2f  position 
) [inline, private]

Draw the action properties beginning at the given position.

Parameters:
appletApplet to draw on
positionThe upper left position to begin the drawing

Definition at line 537 of file ActionDrawInformation.java.

void edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.drawSequence ( PApplet  applet,
Vector2f  position,
Vector2f  drawOffset,
boolean  isExpandedBox 
) [inline, private]

Draw the parent boxes of this action. These are located over the action box

Parameters:
appletApplet to draw on
positionstart position where to begin to draw
Returns:
ArrayList of Vector2f with the points at the center bottom for drawing connection arrows Draw the child boxes of this action. These are located under the extended action box
Parameters:
appletApplet to draw on
positionstart position where to begin to draw
Returns:
ArrayList of Vector2f with the points at the center bottom for drawing connection arrows Connect each point of parentPoints with the current action box. Do the same with child points. The target points will be calculated by this function with a homogeneous distribution over the whole with of the current action box.
Parameters:
appletApplet to draw on
parentPointsConnection points of parent actions
childPointsConnection points of child actions Draw the subsequence boxes of current action.
appletApplet to draw on
positionStart position (upper left corner)

Definition at line 712 of file ActionDrawInformation.java.

void edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.drawSimpleBox ( PApplet  applet,
Vector2f  position,
Vector2f  drawOffset,
float  minHeight 
) [inline]

Draw the simple box. Contains title and properties

Parameters:
appletApplet to draw on
positionPosition where to draw the box
minHeightminimum height of the box.

Definition at line 559 of file ActionDrawInformation.java.

void edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.drawSimpleBox ( PApplet  applet,
Vector2f  position,
Vector2f  drawOffset,
float  minHeight,
boolean  drawExpandBox 
) [inline]

Draw the simple box. Contains title and properties

Parameters:
appletApplet to draw on
positionPosition where to draw the box
minHeightminimum height of the box.

Definition at line 570 of file ActionDrawInformation.java.

Get the bounding box of currently drawn action. If drawn as simple, the simple bounding box is returned, otherwise the extended bounding box.

Returns:
bounding box as rectangle

Definition at line 1180 of file ActionDrawInformation.java.

Get dimension of the extended box. The extended box contains title, properties and subsequences

Returns:
the dimension in pixels of the simple box

Definition at line 372 of file ActionDrawInformation.java.

Get the highlight status of the action

Returns:
the highlight status

Definition at line 1192 of file ActionDrawInformation.java.

Definition at line 1327 of file ActionDrawInformation.java.

Height of title box of the action

Returns:
Height of the name box in pixels

Definition at line 335 of file ActionDrawInformation.java.

Get width of name in pixels.

Returns:
Width of name in pixels

Definition at line 344 of file ActionDrawInformation.java.

Definition at line 1321 of file ActionDrawInformation.java.

Get dimension of the simple box. The simple box contains only title and properties

Returns:
the dimension in pixels of the simple box

Definition at line 354 of file ActionDrawInformation.java.

Get height of drawing text

Returns:
text height

Definition at line 1161 of file ActionDrawInformation.java.

boolean edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.highlightSubsequence ( String  identifier,
boolean  expand 
) [inline]

Search for a subsequence with the given identifier and highlight it (and also it's parents). If expand is true, all sequences will be expanded so that the highlighted sequence is visible.

Parameters:
identifierProlog identifier of the action to highlight
expandexpand all parent actions
Returns:
true if action found and highlighted

Definition at line 1244 of file ActionDrawInformation.java.

Search for the subsequence seq and highlight it (and also it's parents). If expand is true, all sequences will be expanded so that the highlighted sequence is visible.

Parameters:
seqThe action to highlight
expandexpand all parent actions
Returns:
true if action found and highlighted

Definition at line 1286 of file ActionDrawInformation.java.

Get action state if mouse is hovering over this action.

Returns:
true if hovering

Definition at line 1170 of file ActionDrawInformation.java.

Call this if action properties/subsequences/parents/children changed. This tells the class to recalculate the dimensions of all boxes

Definition at line 325 of file ActionDrawInformation.java.

Notify all subsequences that something has changed and recalculation is needed

Parameters:
a

Definition at line 313 of file ActionDrawInformation.java.

Recalculate the dimension of simple/extended box. Only executed if needsRecalculation is set to true (notifyModified called)

Parameters:
appletApplet used to draw the action. Only used for text calculation. Because width of text is dependent on current text setting

Definition at line 406 of file ActionDrawInformation.java.

Set the highlight status of the action

Parameters:
hstatus to set

Definition at line 1201 of file ActionDrawInformation.java.

void edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.setHover ( boolean  hover) [inline, private]

Set the correct colors when hovering over action. If mouse if over action, the hover* colors will be used to draw it.

Parameters:
hoverIf true use hover* colors, otherwise use normal colors

Definition at line 850 of file ActionDrawInformation.java.

Set the correct colors when hovering over expand arrow. If mouse if over expand arrow, the hover* colors will be used to draw it.

Parameters:
hoverIf true use hover* colors, otherwise use normal colors

Definition at line 873 of file ActionDrawInformation.java.

boolean edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.updateHover ( float  x,
float  y 
) [inline]

Update color of action for current mouse position.

Parameters:
xx coordinate of mouse
yy coordinate of mouse
Returns:
true if hovering, false if not

Definition at line 1121 of file ActionDrawInformation.java.


Member Data Documentation

parent action of this draw info

Definition at line 194 of file ActionDrawInformation.java.

final Color edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.arrowBackgroundColor = new Color(51,105,192,230) [static, private]

Background color of arrow between sequence boxes

Definition at line 110 of file ActionDrawInformation.java.

final Color edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.arrowBorderColor = new Color(27, 56, 102) [static, private]

Border color of arrow between sequence boxes

Definition at line 106 of file ActionDrawInformation.java.

final Color edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.arrowExpandBackgroundColor = new Color(125,67,67,230) [static, private]

Background color of arrow expanding box

Definition at line 118 of file ActionDrawInformation.java.

final Color edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.arrowExpandBorderColor = new Color(94, 61, 61) [static, private]

Border color of arrow for expanding box

Definition at line 114 of file ActionDrawInformation.java.

final Color edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.backgroundBrightColor = new Color(50,50,50) [static, private]

Default background color for subsequence box

Definition at line 82 of file ActionDrawInformation.java.

final Color edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.backgroundColor = new Color(30,30,30) [static, private]

Default background color for boxes

Definition at line 78 of file ActionDrawInformation.java.

final Color edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.borderColor = new Color(100, 100, 100) [static, private]

Default border color for boxes

Definition at line 74 of file ActionDrawInformation.java.

Position and dimension of Expanded and Simple box

Definition at line 292 of file ActionDrawInformation.java.

Definition at line 293 of file ActionDrawInformation.java.

Maximum box height over all parent actions of this action. Used to draw all parents with same height Maximum box height over all child actions of this action. Used to draw all parents with same height X position of parent boxes X position of child boxes If parent or child boxes are wider than the extended box, the extended box must be shifted a bit to the right. This shift indicates the following variable.

Definition at line 255 of file ActionDrawInformation.java.

final Vector2f edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.CONNECTOR_DIM = new Vector2f(50f, 7f) [static]

Dimensions of the box-connectors

Definition at line 55 of file ActionDrawInformation.java.

Definition at line 182 of file ActionDrawInformation.java.

Definition at line 181 of file ActionDrawInformation.java.

Following colors are set to default colors if not hovering

Definition at line 180 of file ActionDrawInformation.java.

Definition at line 189 of file ActionDrawInformation.java.

Following colors are set to default colors if not hovering over expand box

Definition at line 188 of file ActionDrawInformation.java.

line/border width of current action

Definition at line 64 of file ActionDrawInformation.java.

Definition at line 183 of file ActionDrawInformation.java.

Default line/border width

Definition at line 60 of file ActionDrawInformation.java.

Used for intern calculation such as if mouse is hovering. Indicates if drawSimpleBox or drawExtendedBox was used to draw this action.

Definition at line 175 of file ActionDrawInformation.java.

total height of the expand box under a subsequence box

Definition at line 50 of file ActionDrawInformation.java.

global position offset (canvas has been dragged)

Definition at line 285 of file ActionDrawInformation.java.

Set to true if this action has additional subsequences which can be expanded.

Definition at line 270 of file ActionDrawInformation.java.

Highlight state of current action

Definition at line 165 of file ActionDrawInformation.java.

final Color edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.highlightBorderColor = new Color(103,134,85) [static, private]

Border color of parents of highlighted action

Definition at line 130 of file ActionDrawInformation.java.

final Color edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.highlightBrightBorderColor = new Color(167,217,137) [static, private]

Border color of hightlighted action

Definition at line 134 of file ActionDrawInformation.java.

final Color edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.hoverArrowExpandBackgroundColor = new Color(190,141,141,230) [static, private]

Background color of arrow expanding box

Definition at line 126 of file ActionDrawInformation.java.

final Color edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.hoverArrowExpandBorderColor = new Color(190, 123, 123) [static, private]

Border color of arrow for expanding box

Definition at line 122 of file ActionDrawInformation.java.

final Color edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.hoverBackgroundBrightColor = new Color(100,100,100) [static, private]

background color for subsequence box when hovering

Definition at line 98 of file ActionDrawInformation.java.

final Color edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.hoverBackgroundColor = new Color(60,60,60) [static, private]

background color for boxes when hovering

Definition at line 94 of file ActionDrawInformation.java.

final Color edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.hoverBorderColor = new Color(200, 200, 200) [static, private]

border color for boxes when hovering

Definition at line 90 of file ActionDrawInformation.java.

final Color edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.hoverTextColor = new Color(255,255,255) [static, private]

text color when hovering

Definition at line 102 of file ActionDrawInformation.java.

Padding between sections of the action. E.g. between properties and subsequence box

Definition at line 38 of file ActionDrawInformation.java.

True if mouse if hovering over this action

Definition at line 205 of file ActionDrawInformation.java.

Text line height

Definition at line 33 of file ActionDrawInformation.java.

action-specific position offset (action has been dragged selectively)

Definition at line 280 of file ActionDrawInformation.java.

Padding between main box border and content

Definition at line 42 of file ActionDrawInformation.java.

Maximum width over all key texts, used to align properties text

Definition at line 215 of file ActionDrawInformation.java.

Height for all actions in the sequence box

Definition at line 265 of file ActionDrawInformation.java.

Maximum width over all value texts, used to calculate max box width

Definition at line 219 of file ActionDrawInformation.java.

Width of the name text, used to calculate max box width

Definition at line 210 of file ActionDrawInformation.java.

set to true if parameters need a recalculation. This is the case if properties/subactions/... have changed

Definition at line 200 of file ActionDrawInformation.java.

current position to draw the main box of the action

Definition at line 275 of file ActionDrawInformation.java.

Height of properties all together. Used to calculate max box height

Definition at line 223 of file ActionDrawInformation.java.

Padding around a single sequence box in the subsequence box

Definition at line 46 of file ActionDrawInformation.java.

Size of the sequence box containing the subsequences of an action.

Definition at line 260 of file ActionDrawInformation.java.

final Color edu.tum.cs.ias.knowrob.vis.actions.ActionDrawInformation.textColor = new Color(240,240,240) [static, private]

Default text color

Definition at line 86 of file ActionDrawInformation.java.

Height of a single text line. Used for calculating text positions

Definition at line 228 of file ActionDrawInformation.java.


The documentation for this class was generated from the following file:


mod_vis
Author(s): Moritz Tenorth, Jakob Engel
autogenerated on Mon Oct 6 2014 01:30:01