Bridges-Java  3.4.2
Bridges(Java API)
Public Member Functions | Protected Member Functions | Static Package Attributes | List of all members
bridges.base.Element< E > Class Template Reference
Inheritance diagram for bridges.base.Element< E >:
bridges.base.DataStruct bridges.base.SLelement< E > bridges.base.TreeElement< E > bridges.base.CircSLelement< E > bridges.base.DLelement< E > bridges.base.MLelement< E > bridges.base.BinTreeElement< E > bridges.base.CircDLelement< E > bridges.base.BSTElement< K, E > bridges.base.AVLTreeElement< K, E > bridges.base.KdTreeElement< K, E >

Detailed Description

This is the main superclass in BRIDGES for deriving a number of objects used in building arrays, lists, trees and graph data structures.

SLelement, DLelement, CircSLelement, CircDLelement, MLelement, TreeElement, BinTreeElement, BSTElement, AVLTreeElement, KdTreeElement are all subclasses (see class hierarchy above). Element contains two visualizer objects (ElementVisualizer, LinkVisualizer) for specifying visual attributes for nodes and links respectively. It also contains a label that that can be displayed in BRIDGES visualizations.

All the tutorials under

https://bridgesuncc.github.io/tutorials/Overview.html

illustrate examples of using different types of Element objects and how to manipulate their visual attributes.

Author
Mihai Mehedint, Kalpathi Subramanian
Parameters
EElements are defined with an application specific generic parameter, that is defined by the user. These can be any legal Java type and manipulated using setValue()/getValue() methods. For more information on Java generics, see for example, https://docs.oracle.com/javase/tutorial/java/generics/types.html

Public Member Functions

String getDataStructType ()
 Get the Element type name. More...
 
 Element ()
 Element constructor. More...
 
 Element (E val)
 the constructor of Element More...
 
 Element (String label, E val)
 Constructor of Element. More...
 
 Element (Element< E > original)
 performing deep copy of an element when needed More...
 
String getIdentifier ()
 
void setSize (double sz)
 
void setColor (Color col)
 
Color getColor ()
 
void setOpacity (float opacity)
 
double getOpacity ()
 
void setShape (String aShape)
 
ElementVisualizer getVisualizer ()
 
void setVisualizer (ElementVisualizer visualizer)
 
LinkVisualizer getLinkVisualizer (Element< E > el)
 Returns the Element's link visualizer object. More...
 
String getClassName ()
 
int compareTo (Element< E > e1)
 
boolean equals (Element< E > e1)
 
String getElementRepresentation ()
 
String getDataStructureRepresentation ()
 
String getLinkRepresentation (LinkVisualizer lv, String src, String dest)
 
String getLabel ()
 
void setLabel (String label)
 
getValue ()
 
void setValue (E value)
 
double getSize ()
 
void setColor (String col)
 Change the element color. More...
 
String getShape ()
 
void setLocation (double locX, double locY)
 Set the location attributes of an element. More...
 
double getLocationX ()
 
double getLocationY ()
 
String toString ()
 

Protected Member Functions

void setLinkVisualizer (Element< E > el)
 Sets the link from this element to a new incoming element. More...
 
void removeLinkVisualizer (Element< E > el)
 Removes the link from this element to a new incoming element. More...
 
void validateVal (E value)
 

Static Package Attributes

static Integer ids = 0
 

Additional Inherited Members

- Protected Attributes inherited from bridges.base.DataStruct
String QUOTE = "\""
 
- Package Attributes inherited from bridges.base.DataStruct
String COMMA = ","
 
String COLON = ":"
 
String OPEN_CURLY = "{"
 
String CLOSE_CURLY = "}"
 
String OPEN_PAREN = "("
 
String CLOSE_PAREN = ")"
 
String OPEN_BOX = "["
 
String CLOSE_BOX = "]"
 

Constructor & Destructor Documentation

◆ Element() [1/4]

Element constructor.

creates an ElementVisualizer object sets a unique identifier for the current Element normally used from subclasses

◆ Element() [2/4]

bridges.base.Element< E >.Element ( val)

the constructor of Element

Parameters
valgeneric parameter value used to construct Element

◆ Element() [3/4]

bridges.base.Element< E >.Element ( String  label,
val 
)

Constructor of Element.

Parameters
labelthe string that is visible on the Bridges Visualization
valgeneric parameter value used to construct Element

◆ Element() [4/4]

bridges.base.Element< E >.Element ( Element< E >  original)

performing deep copy of an element when needed

Parameters
originalthe Element that is to be copied

Member Function Documentation

◆ compareTo()

int bridges.base.Element< E >.compareTo ( Element< E >  e1)

Comparison between 2 elements

Parameters
e1the Element to compare this with
Returns
0 if the 2 elements have the same label and the same identifier and a nonZero integer otherwise

◆ equals()

boolean bridges.base.Element< E >.equals ( Element< E >  e1)

This method compares 2 Elements

Parameters
e1
Returns
boolean

◆ getClassName()

String bridges.base.Element< E >.getClassName ( )

This method returns the name of the class

Returns
the class name "Element"

◆ getColor()

Color bridges.base.Element< E >.getColor ( )

Get the current color of the element

Returns
The color of the element

◆ getDataStructType()

String bridges.base.Element< E >.getDataStructType ( )

◆ getDataStructureRepresentation()

String bridges.base.Element< E >.getDataStructureRepresentation ( )

Return the data structure representation of the element

Returns
the element representation

Reimplemented from bridges.base.DataStruct.

Reimplemented in bridges.base.TreeElement< E >, bridges.base.SLelement< E >, bridges.base.MLelement< E >, and bridges.base.DLelement< E >.

◆ getElementRepresentation()

String bridges.base.Element< E >.getElementRepresentation ( )

Get the JSON representation of the element; used internally to construct the data structure representation

Returns
the encoded JSON string

Reimplemented in bridges.base.KdTreeElement< K, E >, bridges.base.BSTElement< K, E >, and bridges.base.AVLTreeElement< K, E >.

◆ getIdentifier()

String bridges.base.Element< E >.getIdentifier ( )

this method returns the element's unique identifier

Returns
the string identifier

◆ getLabel()

String bridges.base.Element< E >.getLabel ( )

This method returns the current label of the element

Returns
the label of the Element; the label is displayed on BRIDGES visualizations.

◆ getLinkRepresentation()

String bridges.base.Element< E >.getLinkRepresentation ( LinkVisualizer  lv,
String  src,
String  dest 
)

Get the link visualizer representation, iterating through the link properties

Parameters
lvlink visualizer
srcsource node name
destdestination node name

◆ getLinkVisualizer()

LinkVisualizer bridges.base.Element< E >.getLinkVisualizer ( Element< E >  el)

Returns the Element's link visualizer object.

The link visualizer object links this element to another element, which is specified by the argument to this method. This method is typically used to set the visual attributes of the links, such as in graphs or binary tree structures.

Parameters
elthe element terminating the link
Returns
the visualizer of the link from this to el

◆ getLocationX()

double bridges.base.Element< E >.getLocationX ( )

Get the X coordinate of the element's location

Returns
the X coordinate of the element's location attribute

◆ getLocationY()

double bridges.base.Element< E >.getLocationY ( )

Get the Y coordinate of the element's location

Returns
the Y coordinate of the element's location attribute

◆ getOpacity()

double bridges.base.Element< E >.getOpacity ( )

get opacity of element

Returns
current opacity of element (0-1 range)

◆ getShape()

String bridges.base.Element< E >.getShape ( )
Returns
The shape of the element(one of CIRCLE,SQUARE, DIAMOND,CROSS,TRI_DOWN,TRI_UP

◆ getSize()

double bridges.base.Element< E >.getSize ( )

Get element size

Returns
the size (in pixels) of the element

◆ getValue()

E bridges.base.Element< E >.getValue ( )

This method returns the generic object held in the element.

Returns
the value

◆ getVisualizer()

ElementVisualizer bridges.base.Element< E >.getVisualizer ( )

Returns the Element's visualizer object

Returns
the visualizer object

◆ removeLinkVisualizer()

void bridges.base.Element< E >.removeLinkVisualizer ( Element< E >  el)
protected

Removes the link from this element to a new incoming element.

Parameters
elthe terminating element of the link to be removed

◆ setColor() [1/2]

void bridges.base.Element< E >.setColor ( Color  col)

Set the color to "col"

Parameters
colThe color of the element. See the Color class for details

◆ setColor() [2/2]

void bridges.base.Element< E >.setColor ( String  col)

Change the element color.

Parameters
colThe new color of the element. See the Color class for a complete list of supported color names.

◆ setLabel()

void bridges.base.Element< E >.setLabel ( String  label)

This method sets the label

Parameters
labelthe label to set

◆ setLinkVisualizer()

void bridges.base.Element< E >.setLinkVisualizer ( Element< E >  el)
protected

Sets the link from this element to a new incoming element.

This is rarely used, as the constructor will create a link visualizer for this element

Parameters
elthe element to be linked to.

◆ setLocation()

void bridges.base.Element< E >.setLocation ( double  locX,
double  locY 
)

Set the location attributes of an element.

Parameters
[in]locX,locY

◆ setOpacity()

void bridges.base.Element< E >.setOpacity ( float  opacity)

set opacity of element - must be in the range 0.0-1.0

Parameters
opacity

◆ setShape()

void bridges.base.Element< E >.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.Element< E >.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. Must be in the range 1 to 50.

◆ setValue()

void bridges.base.Element< E >.setValue ( value)

This method sets the generic object for this element.

Parameters
valuethe value to set

◆ setVisualizer()

void bridges.base.Element< E >.setVisualizer ( ElementVisualizer  visualizer)

This method sets the visualizer object for the current element object

This is rarely used, as the constructor will create a visualizer for this element

Parameters
visualizerthe visualizer to set

◆ toString()

String bridges.base.Element< E >.toString ( )

◆ validateVal()

void bridges.base.Element< E >.validateVal ( value)
protected

Validates the Element's value when the Element is created A non null value is expected this will be unnecessary after we modify the server

Parameters
value

Member Data Documentation

◆ ids

Integer bridges.base.Element< E >.ids = 0
staticpackage

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