MetaDone
metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape Class Reference
Inheritance diagram for metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape:
Collaboration diagram for metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape:

List of all members.

Public Member Functions

 AbstractWidgetShape (Scene scene)
Stroke getStroke ()
void setStroke (Stroke stroke)
Color getStrokeColor ()
void setStrokeColor (Color strokeColor)
abstract StackingStrategy getDefaultStrategy ()
abstract boolean isConformStrategy (Class<?extends StackingStrategy > strategy)
StackingStrategy getParentStrategy ()
void setParentStrategy (StackingStrategy strategy)
boolean isHitAt (Point localLocation)
Point computeAnchorPoint (Point center, Point target)

Static Public Member Functions

static Point computeRectangularAnchorPoint (Dimension size, Point center, Point target)

Protected Member Functions

abstract Shape getPaintedShape ()
void paintBackground ()
void paintBorder ()

Static Package Functions

static Direction computeDirection (Point source, Point target, double height_width)

Private Attributes

Stroke stroke
Color strokeColor

Static Private Attributes

static final int HIT_DISTANCE = 2

Detailed Description

An abstract widget which renders a shape.

Widget shapes usually contain one widget which is displayed in the center of the shape.

Creating any shape extending this class should be like:

 AbstractWidgetShape shape = new SomeImplOfAShape(scene);
 shape.setStroke(...);
 shape.setStrokeColor(...);
 Widget w = new W_Shape(scene, new SomeImplOfAShape.MyCustomStrategy(),
     shape, contents);
 
Author:
kma
See also:
W_Shape

Constructor & Destructor Documentation

metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.AbstractWidgetShape ( Scene  scene)

Member Function Documentation

Point metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.computeAnchorPoint ( Point  center,
Point  target 
)

Computes the anchor points based on this shape.

null can be returned to indicate that the computation should be skipped, the caller should decide a default position.

Parameters:
centerThe center of the widget
targetThe target point
Returns:
The point where the anchor should be attached or null
See also:
#computeDirection(Point, Point)
computeRectangularAnchorPoint(Dimension, Point, Point)

Reimplemented in metadone.client.grasyla2.visuallibrary.widgets.backgrounds.WidgetOvalShape, and metadone.client.grasyla2.visuallibrary.widgets.backgrounds.WidgetRhombShape.

Referenced by metadone.client.grasyla2.visuallibrary.widgets.backgrounds.ShapeAwareAnchor.computeResult().

static Direction metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.computeDirection ( Point  source,
Point  target,
double  height_width 
) [static, package]

Computes the direction to which the arc is going.

Parameters:
sourceThe source point
targetThe target point
Returns:
The direction

Referenced by metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.computeRectangularAnchorPoint(), and metadone.client.grasyla2.visuallibrary.widgets.backgrounds.ShapeAwareAnchor.computeResult().

static Point metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.computeRectangularAnchorPoint ( Dimension  size,
Point  center,
Point  target 
) [static]

Computes a rectangular anchor placement.

Parameters:
sizeThe size of the component
centerThe center point
targetThe target point
Returns:
The placement of the anchor

References metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.computeDirection().

Referenced by metadone.client.grasyla2.visuallibrary.widgets.backgrounds.ShapeAwareAnchor.computeResult().

abstract StackingStrategy metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.getDefaultStrategy ( ) [pure virtual]
StackingStrategy metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.getParentStrategy ( )

Gets the stacking strategy from the parent widget.

Returns:
The stacking strategy or null on failure

References metadone.util.Objects.cast(), and metadone.client.grasyla2.visuallibrary.widgets.layouts.StackingLayout.getStrategy().

Referenced by metadone.client.grasyla2.visuallibrary.VLShapeEngine.VLShapeEngine().

Stroke metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.getStroke ( )
Color metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.getStrokeColor ( )
abstract boolean metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.isConformStrategy ( Class<?extends StackingStrategy strategy) [pure virtual]
boolean metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.isHitAt ( Point  localLocation)
void metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.paintBackground ( ) [protected]
void metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.setParentStrategy ( StackingStrategy  strategy)

Sets a new strategy to the layout of the parent widget.

Parameters:
strategyThe new strategy to set
Exceptions:
IllegalArgumentExceptionwhen the strategy is invalid

References metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.isConformStrategy(), and metadone.client.grasyla2.visuallibrary.widgets.layouts.StackingLayout.setStrategy().

Referenced by metadone.client.grasyla2.visuallibrary.VLShapeEngine.VLShapeEngine().

void metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.setStroke ( Stroke  stroke)
void metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.setStrokeColor ( Color  strokeColor)

Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations