Bridges-Java  3.4.3
Bridges(Java API)
Public Member Functions | Package Functions | Package Attributes | List of all members
bridges.base.Rectangle Class Reference
Inheritance diagram for bridges.base.Rectangle:
bridges.base.Symbol

Detailed Description

This class defines a rectangle and is part of the bridges::base::SymbolCollection.

A rectangle has height and width, and a location (rectangle center)

Basic styling such as stroke, fill, color are defined in the superclass Symbol.

See also
An example tutorial can be found at https://bridgesuncc.github.io/tutorials/Symbol_Collection.html
Author
Kalpathi Subramanian, Erik Saule
Date
12/23/18, 6/22/21

Public Member Functions

 Rectangle ()
 
 Rectangle (float w, float h)
 
 Rectangle (float locx, float locy, float w, float h)
 
float getLocationX ()
 
float getLocationY ()
 
String getShapeType ()
 
void setWidth (float w)
 
float getWidth ()
 
float getHeight ()
 
void setRectangle (float locx, float locy, float w, float h)
 
JSONObject getJSONRepresentation ()
 
- Public Member Functions inherited from bridges.base.Symbol
 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 ()
 
void addAllJSON (JSONArray symbol_json, Integer parent)
 

Package Functions

void setHeight (float h)
 

Package Attributes

float height = 1.0f
 
float locy = 0.0f
 
- Package Attributes inherited from bridges.base.Symbol
Boolean xform_flag = false
 

Additional Inherited Members

- Protected Attributes inherited from bridges.base.Symbol
String label = null
 
Color fillColor = null
 
Float opacity = null
 
Color strokeColor = null
 
Float strokeWidth = null
 
Integer strokeDash = null
 
Integer layer = null
 
float[] transform = null
 

Constructor & Destructor Documentation

◆ Rectangle() [1/3]

bridges.base.Rectangle.Rectangle ( )

Construct a default rectangle

◆ Rectangle() [2/3]

bridges.base.Rectangle.Rectangle ( float  w,
float  h 
)

Construct a rectangle with given height and width

Parameters
wwidth of rectangle
hheight of rectangle

◆ Rectangle() [3/3]

bridges.base.Rectangle.Rectangle ( float  locx,
float  locy,
float  w,
float  h 
)

Construct a rectangle with given its location (center), height and width

Parameters
locxx coordinate of center
locyy coordinate of center
wwidth of rectangle
hheight of rectangle

Member Function Documentation

◆ getHeight()

float bridges.base.Rectangle.getHeight ( )

◆ getJSONRepresentation()

JSONObject bridges.base.Rectangle.getJSONRepresentation ( )

This method returns the JSON representation of the shape

Returns
JSON representation of rectangle (string)

Reimplemented from bridges.base.Symbol.

◆ getLocationX()

float bridges.base.Rectangle.getLocationX ( )

◆ getLocationY()

float bridges.base.Rectangle.getLocationY ( )

◆ getShapeType()

String bridges.base.Rectangle.getShapeType ( )

This method gets the name of the shape

Returns
name shape name

Reimplemented from bridges.base.Symbol.

◆ getWidth()

float bridges.base.Rectangle.getWidth ( )

◆ setHeight()

void bridges.base.Rectangle.setHeight ( float  h)
package

This method sets the shape height

Parameters
hheight

◆ setRectangle()

void bridges.base.Rectangle.setRectangle ( float  locx,
float  locy,
float  w,
float  h 
)

◆ setWidth()

void bridges.base.Rectangle.setWidth ( float  w)

This method sets the shape width

Parameters
wwidth

Member Data Documentation

◆ height

float bridges.base.Rectangle.height = 1.0f
package

◆ locy

float bridges.base.Rectangle.locy = 0.0f
package

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