MetaDone
|
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 |
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);
metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.AbstractWidgetShape | ( | Scene | scene | ) |
Creates a new abstract shape.
scene | The scene |
References metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.setStroke(), and metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.setStrokeColor().
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.
center | The center of the widget |
target | The target point |
null
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.
source | The source point |
target | The target point |
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.
size | The size of the component |
center | The center point |
target | The target point |
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] |
Gets an instance of a default stacking strategy conform to this shape.
Implemented in metadone.client.grasyla2.visuallibrary.widgets.backgrounds.WidgetOvalShape, metadone.client.grasyla2.visuallibrary.widgets.backgrounds.WidgetRectangleShape, metadone.client.grasyla2.visuallibrary.widgets.backgrounds.WidgetRhombShape, and metadone.client.grasyla2.visuallibrary.widgets.backgrounds.WidgetTapeShape.
Referenced by metadone.client.grasyla2.visuallibrary.widgets.W_Shape.W_Shape().
abstract Shape metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.getPaintedShape | ( | ) | [protected, pure virtual] |
Gets a shape that is painted in the background.
Implemented in metadone.client.grasyla2.visuallibrary.widgets.backgrounds.WidgetOvalShape, metadone.client.grasyla2.visuallibrary.widgets.backgrounds.WidgetRectangleShape, metadone.client.grasyla2.visuallibrary.widgets.backgrounds.WidgetRhombShape, and metadone.client.grasyla2.visuallibrary.widgets.backgrounds.WidgetTapeShape.
Referenced by metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.isHitAt(), metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.paintBackground(), and metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.paintBorder().
StackingStrategy metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.getParentStrategy | ( | ) |
Gets the stacking strategy from the parent widget.
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 | ( | ) |
Gets the stroke which paints the shape.
References metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.stroke.
Referenced by metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.paintBorder().
Color metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.getStrokeColor | ( | ) |
Gets the color of the stroke which paints the shape.
References metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.strokeColor.
Referenced by metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.paintBorder().
abstract boolean metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.isConformStrategy | ( | Class<?extends StackingStrategy > | strategy | ) | [pure virtual] |
Checks if a strategy is conform to the shape.
Usually the implementation is:
return MyCustomStrategy.class.isAssignableFrom(strategy);
The | strategy to check |
NullPointerException | when strategy is null |
Implemented in metadone.client.grasyla2.visuallibrary.widgets.backgrounds.WidgetOvalShape, metadone.client.grasyla2.visuallibrary.widgets.backgrounds.WidgetRectangleShape, metadone.client.grasyla2.visuallibrary.widgets.backgrounds.WidgetRhombShape, and metadone.client.grasyla2.visuallibrary.widgets.backgrounds.WidgetTapeShape.
Referenced by metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.setParentStrategy(), and metadone.client.grasyla2.visuallibrary.widgets.W_Shape.W_Shape().
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.paintBorder | ( | ) | [protected] |
References metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.getPaintedShape(), metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.getStroke(), and metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.getStrokeColor().
void metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.setParentStrategy | ( | StackingStrategy | strategy | ) |
Sets a new strategy to the layout of the parent widget.
strategy | The new strategy to set |
IllegalArgumentException | when 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 | ) |
Sets the stroke.
A BasicStroke is used if the given stroke is null
.
stroke | The new stroke |
References metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.stroke.
Referenced by metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.AbstractWidgetShape().
void metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.setStrokeColor | ( | Color | strokeColor | ) |
Sets the color of the stroke.
Color#BLACK is used if the given stroke is null
.
stroke | The new stroke |
References metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.strokeColor.
Referenced by metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.AbstractWidgetShape(), and metadone.client.grasyla2.visuallibrary.widgets.RotateWidget.RotateWidget().
final int metadone.client.grasyla2.visuallibrary.widgets.backgrounds.AbstractWidgetShape.HIT_DISTANCE = 2 [static, private] |