Bridges-Java-3.0.1  3.0.1
Bridges(JavaAPI)
Public Member Functions | 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 symbol collection. A rectangle has height and width.

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

Author
Kalpathi Subramanian
Date
12/23/18

Public Member Functions

 Rectangle ()
 
 Rectangle (float w, float h)
 
 Rectangle (float locx, float locy, float w, float h)
 
String getName ()
 
void setWidth (float w)
 
float [] getDimensions ()
 
void setRectangle (float locx, float locy, float w, float h)
 
void translate (float tx, float ty)
 
void scale (float sx, float sy)
 
JSONObject getJSONRepresentation ()
 
- Public Member Functions inherited from bridges.base.Symbol
 Symbol ()
 
void setLabel (String label)
 
String getLabel ()
 
String getIdentifier ()
 
void setFillColor (Color c)
 
void setFillColor (String c)
 
Color getFillColor ()
 
void setStrokeColor (Color c)
 
Symbol setStrokeColor (String c)
 
Color getStrokeColor ()
 
void 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 ()
 
void setLocation (float x, float y)
 
float [] getLocation ()
 
float [] getDimensions ()
 
JSONObject getJSONRepresentation ()
 

Additional Inherited Members

- Protected Member Functions inherited from bridges.base.Symbol
String getShapeType ()
 
void setShapeType (String sh)
 
void translatePoint (float[] pt, float tx, float ty)
 
- Protected Attributes inherited from bridges.base.Symbol
String label = ""
 
Color fillColor = new Color("blue")
 
float opacity = DEFAULT_OPACITY
 
Color strokeColor = new Color("white")
 
float strokeWidth = DEFAULT_STROKEWIDTH
 
Integer strokeDash = DEFAULT_STROKEDASH
 
float locationX = DEFAULT_LOCATIONX
 
float locationY = DEFAULT_LOCATIONY
 

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

◆ getDimensions()

float [] bridges.base.Rectangle.getDimensions ( )

This method returns the dimensions of the shape: min and max values in X and Y

Returns
rectangle's bounding box (array of 4 values)

◆ getJSONRepresentation()

JSONObject bridges.base.Rectangle.getJSONRepresentation ( )

This method returns the JSON representation of the shape

Returns
JSON representation of rectangle (string)

◆ getName()

String bridges.base.Rectangle.getName ( )

This method gets the name of the shape

Returns
name shape name

◆ scale()

void bridges.base.Rectangle.scale ( float  sx,
float  sy 
)

Scale the rectangle about its center

Parameters
sx,syscale factor along each axis

◆ 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

◆ translate()

void bridges.base.Rectangle.translate ( float  tx,
float  ty 
)

Translate the rectangle

Parameters
tx,tytranslation vector

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