Bridges-Java  3.4.3
Bridges(Java API)
Public Member Functions | Package Attributes | List of all members
bridges.base.ElementVisualizer Class Reference

Detailed Description

This class maintains the visual attributes of each BRIDGES element.

Visual properties include color, shape, opacity, size and location. Objects of this class are stored as part of the Element class. Generally, a user will manipulate the ElementVisualizer returned from the Element's getVisualizer() method (rather than creating this object directly), and then set attributes using its methods. Supported attributed values are as follows:

Color: Supported colors by name using setColor(): See the Color class for the complete list; colors are set by by RGBA Specification, 0-255 for each component, or using color names.

Supported Shapes: "circle", "square", "diamond", "cross", "triangle", "star", "wye". set it with setShape() and getShape().

Shape Size : Range [0-50]. Set it with setSize() and getSize().

Opacity: Range [0.0 - 1.0]. Use it with setOpacity(), getOpacity().

Location: Use it with setLocation(), getLocationX(), and getLocationY().

Author
Mihai Mehedint, Kalpathi Subramanian
Date
6/22/16, 1/7/17, 5/17/17, 7/14/19
See also
Example Tutorial (with singly linked list) at
https://bridgesuncc.github.io/tutorials/SinglyLinkedList.html

Public Member Functions

 ElementVisualizer ()
 
 ElementVisualizer (String aColor)
 
 ElementVisualizer (String aColor, String aShape)
 
 ElementVisualizer (double size)
 
 ElementVisualizer (String aColor, String aShape, float opacity, double size)
 Construct an ElementVisualizer with given color, shape, opacity, and size. More...
 
 ElementVisualizer (ElementVisualizer v)
 
void setSize (double sz)
 
double getSize ()
 
void setColor (String col_name) throws InvalidValueException
 Set the color of the Element in the Bridges Visualization. More...
 
void setColor (Integer r, Integer g, Integer b, float a)
 Set the color of the Element in the Bridges Visualization given RGBA components. More...
 
void setColor (Color c)
 Set the color of the Element in the Bridges Visualization. More...
 
Color getColor ()
 
String getShape ()
 
void setShape (String aShape)
 
void setOpacity (float opacity)
 
float getOpacity ()
 Get the opacity of the Element in the Bridges Visualization. More...
 
void setLocation (double x, double y)
 Set the location (x, y) of the element. More...
 
double getLocationX ()
 Get the X coordinate position of the element. More...
 
double getLocationY ()
 Get the Y coordinate position of the element. More...
 

Package Attributes

String key = ""
 
double locationY = Double.POSITIVE_INFINITY
 
double size = 10.0
 

Constructor & Destructor Documentation

◆ ElementVisualizer() [1/6]

bridges.base.ElementVisualizer.ElementVisualizer ( )

Construct an ElementVisualizer with the default visualization settings.

The default settings are color = [70, 130, 180, 1.0], opacity = 1.0, size = 10.0, shape = circle.

◆ ElementVisualizer() [2/6]

bridges.base.ElementVisualizer.ElementVisualizer ( String  aColor)

Construct an ElementVisualizer with its color set to "aColor".

Parameters
aColorthe string that represents one of the Bridges colors.

◆ ElementVisualizer() [3/6]

bridges.base.ElementVisualizer.ElementVisualizer ( String  aColor,
String  aShape 
)

Construct an ElementVisualizer with its color set to "aColor" and shape set to "aShape".

Parameters
aColorthe string that represents one of the Bridges colors.
aShapethe string that represents one of the Bridges shapes

◆ ElementVisualizer() [4/6]

bridges.base.ElementVisualizer.ElementVisualizer ( double  size)

Construct an ElementVisualizer with its size set to "size".

Parameters
sizethe value that represents the size in pixels of the Bridges Element

◆ ElementVisualizer() [5/6]

bridges.base.ElementVisualizer.ElementVisualizer ( String  aColor,
String  aShape,
float  opacity,
double  size 
)

Construct an ElementVisualizer with given color, shape, opacity, and size.

Parameters
aColorthe string that represents one of the Bridges colors.
aShapethe string that represents one of the Bridges shapes
opacitya double in [0;1] for varying transparency representing how transparent the node should. 0 for invisible, 1 for fully visible/
sizethe double that represents the size of the Element on the Bridges Visualization

◆ ElementVisualizer() [6/6]

bridges.base.ElementVisualizer.ElementVisualizer ( ElementVisualizer  v)

Construct a new ElementVisualizer with the same color, shape, opacity, and size as "v"

Parameters
vthe ElementVisualizer whose settings you want to copy.

Member Function Documentation

◆ getColor()

Color bridges.base.ElementVisualizer.getColor ( )

Get the color of the Element in the Bridges Visualization

Returns
Color object representing the color of the Element as R,G,B,A components, each in the range 0-255

◆ getLocationX()

double bridges.base.ElementVisualizer.getLocationX ( )

Get the X coordinate position of the element.

Returns
location X coordinate

◆ getLocationY()

double bridges.base.ElementVisualizer.getLocationY ( )

Get the Y coordinate position of the element.

Returns
location Y coordinate

◆ getOpacity()

float bridges.base.ElementVisualizer.getOpacity ( )

Get the opacity of the Element in the Bridges Visualization.

Returns
the opacity value

◆ getShape()

String bridges.base.ElementVisualizer.getShape ( )

Get the shape of the Element in the Bridges Visualization.

Returns
the string that represents the Element's shape in the Bridges Visualization.

◆ getSize()

double bridges.base.ElementVisualizer.getSize ( )

Get the size of the Element in the Bridges Visualization

Returns
the size in pixels of the Element in the Bridges Visualization

◆ setColor() [1/3]

void bridges.base.ElementVisualizer.setColor ( Color  c)

Set the color of the Element in the Bridges Visualization.

Parameters
cColor to set.

◆ setColor() [2/3]

void bridges.base.ElementVisualizer.setColor ( Integer  r,
Integer  g,
Integer  b,
float  a 
)

Set the color of the Element in the Bridges Visualization given RGBA components.

Parameters
r,g,b,acolor components. r, g, b are in the [0-255] range, a in [0,1].

◆ setColor() [3/3]

void bridges.base.ElementVisualizer.setColor ( String  col_name) throws InvalidValueException

Set the color of the Element in the Bridges Visualization.

Parameters
col_namethe string reprsenting the color of the Element in the Bridges Visualization; see the Color class for the list of supported colors

◆ setLocation()

void bridges.base.ElementVisualizer.setLocation ( double  x,
double  y 
)

Set the location (x, y) of the element.

Parameters
x,ylocation to be set

◆ setOpacity()

void bridges.base.ElementVisualizer.setOpacity ( float  opacity)

Sets the opacity of the Element in the Bridges Visualization (0.0-1.0)

Parameters
opacitya double between 0 and 1 representing how transparent the node should be on the Bridges Visualization. 0 for invisible, 1 for fully visible, a decimal between 0 and 1 for varying transparency.

◆ setShape()

void bridges.base.ElementVisualizer.setShape ( String  aShape)

Sets the shape of the Element in the Bridges Visualization. Supported shapes include "star", "circle", "square", "diamond", "cross", "triangle", "wye".

Parameters
aShapethe string representing the shape of the Element in the Bridges Visualization

◆ setSize()

void bridges.base.ElementVisualizer.setSize ( double  sz)

Set the size of the Element in the Bridge Visualization (in pixel units)

Parameters
szthe pixel size of the Element in the Bridges Visualization

Member Data Documentation

◆ key

String bridges.base.ElementVisualizer.key = ""
package

◆ locationY

double bridges.base.ElementVisualizer.locationY = Double.POSITIVE_INFINITY
package

◆ size

double bridges.base.ElementVisualizer.size = 10.0
package

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