Bridges-Java
3.4.3
Bridges(Java API)
|
This is a class in BRIDGES for deriving a number of Symbol objects for use in a SymbolCollection.
It is not intended that objects from this class will be directly created. Rather, we expect that classes that derive from this class be instantiated such as Circle, Polyline, Polygon, Rectangle, Text.
Symbols correspond to a simplified subset of SVG paths and shapes for custom visual representations in BRIDGES.
The stroke is the actual lines that get drawn (such as the perimeter of a rectangle) and its style is controlled by setStrokeColor(), setStrokeWidth(), and setStrokeDash().
The inside of the Symbol can be colored independently from the stroke using setFillColor().
Affine transformations are supported with each symbol. If specified, these will transform the shape (pre-multiply); translation, rotation and scale transforms are supported. These can be chained to form a composite transform
The overall Symbol can be made more of less visible by adjusting its opacity using setOpacity().
@author David Burlinson, Kalpathi Subramanian, Erik Saule
Public Member Functions | |
Symbol () | |
Symbol | setLabel (String label) |
String | getLabel () |
Symbol | setFillColor (String c) |
Symbol | setFillColor (Color c) |
Color | getFillColor () |
Symbol | setStrokeColor (Color c) |
Symbol | setStrokeColor (String c) |
Color | getStrokeColor () |
Symbol | setStrokeWidth (float strokewidth) |
This method sets the symbol stroke width. More... | |
Float | getStrokeWidth () |
Symbol | setOpacity (float op) |
This method sets the symbol opacity. More... | |
Float | getOpacity () |
Symbol | setStrokeDash (int dash) |
Integer | getStrokeDash () |
Symbol | setLayer (int layer) |
Integer | getLayer () |
float[][] | identity (float[][] m) |
Symbol | translate (float tx, float ty) |
Symbol | scale (float s) |
Symbol | scale (float sx, float sy) |
Symbol | rotate (float angle) |
Symbol | scale (float sx, float sy, float px, float py) |
Symbol | rotate (float angle, float px, float py) |
Symbol | setTransform (float a, float b, float c, float d, float e, float f) |
float[][] | getTransform () |
JSONObject | getJSONRepresentation () |
void | addAllJSON (JSONArray symbol_json, Integer parent) |
Protected Member Functions | |
String | getShapeType () |
Protected Attributes | |
String | label = null |
Color | fillColor = null |
Float | opacity = null |
Color | strokeColor = null |
Float | strokeWidth = null |
Integer | strokeDash = null |
Integer | layer = null |
float[] | transform = null |
Package Attributes | |
Boolean | xform_flag = false |
bridges.base.Symbol.Symbol | ( | ) |
Create a default symbol object
void bridges.base.Symbol.addAllJSON | ( | JSONArray | symbol_json, |
Integer | parent | ||
) |
Reimplemented in bridges.base.SymbolGroup.
Color bridges.base.Symbol.getFillColor | ( | ) |
This method gets fill color
JSONObject bridges.base.Symbol.getJSONRepresentation | ( | ) |
Internal code for getting the representation of the Symbol object.
Reimplemented in bridges.base.Text, bridges.base.Rectangle, bridges.base.Polyline, and bridges.base.Circle.
String bridges.base.Symbol.getLabel | ( | ) |
This method gets the symbol label
Integer bridges.base.Symbol.getLayer | ( | ) |
This method gets layer
Float bridges.base.Symbol.getOpacity | ( | ) |
This method gets symbol opacity
|
protected |
Get the shape type
Reimplemented in bridges.base.Text, bridges.base.SymbolGroup, bridges.base.Rectangle, bridges.base.Polyline, bridges.base.Polygon, and bridges.base.Circle.
Color bridges.base.Symbol.getStrokeColor | ( | ) |
This method gets stroke color
Integer bridges.base.Symbol.getStrokeDash | ( | ) |
This method gets stroke dash level
Float bridges.base.Symbol.getStrokeWidth | ( | ) |
This method gets stroke width
float [][] bridges.base.Symbol.getTransform | ( | ) |
This method returns the affine transformation associated with this symbol
float [][] bridges.base.Symbol.identity | ( | float | m[][] | ) |
create the identity matrix
m | 3x3 input matrix |
Symbol bridges.base.Symbol.rotate | ( | float | angle | ) |
rotate the symbol by angle theta about Z axis (2D rotation), updates the current transform matrix; note: rotation is about the origin
angle | angle (in degrees) |
Symbol bridges.base.Symbol.rotate | ( | float | angle, |
float | px, | ||
float | py | ||
) |
rotate the symbol by angle theta about Z axis (2D rotation) about the point (px, py)
angle | angle (in degrees) |
Symbol bridges.base.Symbol.scale | ( | float | s | ) |
scale the symbol by s along X and Y axes updates the current transform matrix; note: scale is about the origin
s | scale factor |
Symbol bridges.base.Symbol.scale | ( | float | sx, |
float | sy | ||
) |
scale the symbol by sx, sy along the X and Y axes, updates the current transform matrix; note: scale is about the origin
sx | scale factor in X |
sy | scale factor in Y |
Symbol bridges.base.Symbol.scale | ( | float | sx, |
float | sy, | ||
float | px, | ||
float | py | ||
) |
scale the symbol by (sx, sy) along the X and Y axes about the point (px, py); updates the current transform matrix;
sx | scale factor in X |
sy | scale factor in Y |
px | x coordinate of point |
py | y coordinate of point |
This method sets the symbol fill color
c | the color to set |
Symbol bridges.base.Symbol.setFillColor | ( | String | c | ) |
This method sets the symbol fill color
c | the color to set |
Symbol bridges.base.Symbol.setLabel | ( | String | label | ) |
This method sets the label
label | the label to set |
Symbol bridges.base.Symbol.setLayer | ( | int | layer | ) |
This method sets the layer the symbol sits on
layer | layer (lower value closer to camera) |
Symbol bridges.base.Symbol.setOpacity | ( | float | op | ) |
This method sets the symbol opacity.
op | the opacity to set |
This method sets the symbol stroke color
c | the color to set |
Symbol bridges.base.Symbol.setStrokeColor | ( | String | c | ) |
This method sets the symbol stroke color
c | the named color to set |
Symbol bridges.base.Symbol.setStrokeDash | ( | int | dash | ) |
This method sets the stroke dash level
dash | dash level |
Symbol bridges.base.Symbol.setStrokeWidth | ( | float | strokewidth | ) |
This method sets the symbol stroke width.
This is the weight of the individual lines that are drawn, such as the perimeter of a rectangle.
strokewidth | the stroke width to set |
Symbol bridges.base.Symbol.setTransform | ( | float | a, |
float | b, | ||
float | c, | ||
float | d, | ||
float | e, | ||
float | f | ||
) |
This method sets the transform matrix for this symbol; terms passed in column major order.
a | transformation term |
b | transformation term |
c | transformation term |
d | transformation term |
e | transformation term |
f | transformation term |
Symbol bridges.base.Symbol.translate | ( | float | tx, |
float | ty | ||
) |
translate the symbol by tx, ty along the X and Y axes, updates the current transform matrix
tx | translation in X |
ty | translation in Y |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
package |