Bridges-Java  3.4.2
Bridges(Java API)
Public Member Functions | Protected Member Functions | Protected Attributes | Package Attributes | List of all members
bridges.base.Symbol Class Referenceabstract
Inheritance diagram for bridges.base.Symbol:
bridges.base.Circle bridges.base.Polyline bridges.base.Rectangle bridges.base.SymbolGroup bridges.base.Text bridges.base.Polygon

Detailed Description

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().

See also
An example tutorial can be found at https://bridgesuncc.github.io/tutorials/Symbol_Collection.html
@author David Burlinson, Kalpathi Subramanian, Erik Saule
Date
2018, 7/15/19
2020, 6/22/21

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
 

Constructor & Destructor Documentation

◆ Symbol()

bridges.base.Symbol.Symbol ( )

Create a default symbol object

Member Function Documentation

◆ addAllJSON()

void bridges.base.Symbol.addAllJSON ( JSONArray  symbol_json,
Integer  parent 
)

Reimplemented in bridges.base.SymbolGroup.

◆ getFillColor()

Color bridges.base.Symbol.getFillColor ( )

This method gets fill color

Returns
fill color

◆ getJSONRepresentation()

JSONObject bridges.base.Symbol.getJSONRepresentation ( )

Internal code for getting the representation of the Symbol object.

Returns
the encoded JSON string

Reimplemented in bridges.base.Text, bridges.base.Rectangle, bridges.base.Polyline, and bridges.base.Circle.

◆ getLabel()

String bridges.base.Symbol.getLabel ( )

This method gets the symbol label

Returns
symbol label

◆ getLayer()

Integer bridges.base.Symbol.getLayer ( )

This method gets layer

Returns
layer layer (lower value closer to camera)

◆ getOpacity()

Float bridges.base.Symbol.getOpacity ( )

This method gets symbol opacity

Returns
symbol opacity

◆ getShapeType()

String bridges.base.Symbol.getShapeType ( )
protected

◆ getStrokeColor()

Color bridges.base.Symbol.getStrokeColor ( )

This method gets stroke color

Returns
stroke color

◆ getStrokeDash()

Integer bridges.base.Symbol.getStrokeDash ( )

This method gets stroke dash level

Returns
stroke dash level

◆ getStrokeWidth()

Float bridges.base.Symbol.getStrokeWidth ( )

This method gets stroke width

Returns
stroke width

◆ getTransform()

float [][] bridges.base.Symbol.getTransform ( )

This method returns the affine transformation associated with this symbol

Returns
transformation matrix

◆ identity()

float [][] bridges.base.Symbol.identity ( float  m[][])

create the identity matrix

Parameters
m3x3 input matrix

◆ rotate() [1/2]

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

Parameters
angleangle (in degrees)

◆ rotate() [2/2]

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)

Parameters
angleangle (in degrees)

◆ scale() [1/3]

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

Parameters
sscale factor

◆ scale() [2/3]

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

Parameters
sxscale factor in X
syscale factor in Y

◆ scale() [3/3]

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;

Parameters
sxscale factor in X
syscale factor in Y
pxx coordinate of point
pyy coordinate of point

◆ setFillColor() [1/2]

Symbol bridges.base.Symbol.setFillColor ( Color  c)

This method sets the symbol fill color

Parameters
cthe color to set
Returns
the symbol

◆ setFillColor() [2/2]

Symbol bridges.base.Symbol.setFillColor ( String  c)

This method sets the symbol fill color

Parameters
cthe color to set
Returns
the symbol

◆ setLabel()

Symbol bridges.base.Symbol.setLabel ( String  label)

This method sets the label

Parameters
labelthe label to set

◆ setLayer()

Symbol bridges.base.Symbol.setLayer ( int  layer)

This method sets the layer the symbol sits on

Parameters
layerlayer (lower value closer to camera)
Returns
the symbol

◆ setOpacity()

Symbol bridges.base.Symbol.setOpacity ( float  op)

This method sets the symbol opacity.

Parameters
opthe opacity to set
Returns
the symbol

◆ setStrokeColor() [1/2]

Symbol bridges.base.Symbol.setStrokeColor ( Color  c)

This method sets the symbol stroke color

Parameters
cthe color to set
Returns
the symbol

◆ setStrokeColor() [2/2]

Symbol bridges.base.Symbol.setStrokeColor ( String  c)

This method sets the symbol stroke color

Parameters
cthe named color to set
Returns
the symbol

◆ setStrokeDash()

Symbol bridges.base.Symbol.setStrokeDash ( int  dash)

This method sets the stroke dash level

Parameters
dashdash level
Returns
the symbol

◆ setStrokeWidth()

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.

Parameters
strokewidththe stroke width to set
Returns
the symbol

◆ setTransform()

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.

Parameters
atransformation term
btransformation term
ctransformation term
dtransformation term
etransformation term
ftransformation term
Returns
the symbol

◆ translate()

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

Parameters
txtranslation in X
tytranslation in Y

Member Data Documentation

◆ fillColor

Color bridges.base.Symbol.fillColor = null
protected

◆ label

String bridges.base.Symbol.label = null
protected

◆ layer

Integer bridges.base.Symbol.layer = null
protected

◆ opacity

Float bridges.base.Symbol.opacity = null
protected

◆ strokeColor

Color bridges.base.Symbol.strokeColor = null
protected

◆ strokeDash

Integer bridges.base.Symbol.strokeDash = null
protected

◆ strokeWidth

Float bridges.base.Symbol.strokeWidth = null
protected

◆ transform

float [] bridges.base.Symbol.transform = null
protected

◆ xform_flag

Boolean bridges.base.Symbol.xform_flag = false
package

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