com.ericsson.tic.vi
Class VI

java.lang.Object
  extended by com.ericsson.tic.vi.VI

public class VI
extends Object

VI holds the main method, all globally accessed static variables and constants as well as some static methods used for the initialization.

Version:
1.0 (2008-12-04)
Author:
Sami Matilainen

Field Summary
static boolean barShadingOn
          True if bar shading is turned on.
static int barType
          The current bar type.
static boolean betterLightingOn
          Enables better lighting.
static Texture blankTex
          World map texture.
static float[] blueColor
          Blue.
static int brushedCategory
           
static Color BRUSHING_OFF_COLOR_DEFAULT
          Brushing Suppressed color.
static Color BRUSHING_PRIMARY_COLOR_DEFAULT
          The primary brushing color.
static Color BRUSHING_SECONDARY_COLOR_DEFAULT
          The secondary brushing color.
static Color brushingOffColor
          Brushing Suppressed color.
static boolean brushingOn
          If brushing is on.
static Color brushingPrimaryColor
          The primary brushing color.
static Color brushingSecondaryColor
          The secondary brushing color.
static ImageIcon brushOffIcon
          An image.
static ImageIcon brushOnIcon
          An image.
private static int build
          The current buildnumber of this software.
static Category[] categoryArr
          A list of categories.
static LinkedList<Category> categoryList
          A list of categories as an array.
static Hashtable<String,Integer> catID
          A hashtable containing an ID, hostname pair.
static Command[] commandArr
          A list of commands.
static int CONSOLE_INPUT_CAPACITY
          The size of the console input buffer
static RawBuffer consoleInputBuffer
          A buffer used for storing user input messages.
static LinkedList<ConsolePanel> consoleList
          A list of console panels.
static boolean coreRunning
          If true, the core is running.
static long currentTimeStamp
          The current time.
static ConsolePanel d
          The console.
static Data[] dataArr
          A list of data
static Hashtable<String,Integer> dataID
          A hashtable containing an ID, data set name pair.
static int DEFAULT_UDPIN_PORT
          The default port number used for incoming messages from the TIC.
static String DEFAULT_UDPOUT_HOST
          The default host where the TIC listens for incoming messages.
static int DEFAULT_UDPOUT_PORT
          The default port on which the TIC is assumed to listen for messages from the VI ynode
static float defaultValue
          The default value used for the timeout.
static ImageIcon downArrowIcon
          An image.
static boolean focusInView
          If focus is in view.
static boolean fogOn
          True if fog is turned on.
static int GLOBE_MOVE_DELAY
          The default dealy time (in tics) for "movement inertia"
static float GLOBE_ROT_ANGLE_DEFAULT
          The default rot-angle.
static float GLOBE_TILT_ANGLE_DEFAULT
          The default tilt-angle.
static float GLOBE_ZOOM_DEFAULT
          The default zoom distance.
static float GLOBE_ZOOM_MAX
          The maximum zoom distance.
static float GLOBE_ZOOM_MIN
          The minimum allowed zooming distance.
static boolean globeRotationOn
          Automatic globe rotation.
static boolean globeViewOn
          If globe view is on.
static float[] greenColor
          Green.
static float[] greyColor
          Grey (80%).
static boolean ignoreShift
          If true, panning and tilting is not separated.
static boolean infiniteMoveDelayOn
          If true, tilting continues for eternity.
static String keepAliveHost
          The default host where the TIC listens for incoming messages.
static int keepAlivePort
          The default port on which the TIC is assumed to listen for messages from the VI ynode
static ImageIcon leftArrowIcon
          An image.
static boolean lineAAOn
          True if line shading is turned on.
static int MESSAGE_MAX_WIDTH
          The maximum size of incoming messages.
static boolean mPressed
          If m-key is pressed.
static GraphNode[] nodeArr
          A list of graph nodes as an array.
static Hashtable<String,Integer> nodeID
          A hashtable containing an ID, hostname pair.
static LinkedList<GraphNode> nodeList
          A list of graph nodes.
static Data[] nodeMultiData
          A list of multidimensional node data
static LinkedList<Data> nodeMultiDataList
          A list of multidimensional node data
static String[] nodeMultiDataStrings
          Strings used by the GUI to display node-multideimensional data.
static GraphNodeRel[] nodeRelArr
          A list of node relations as an array.
static LinkedList<GraphNodeRel> nodeRelList
          A list of node relations.
static boolean nodeShadingOn
          True if node shading is turned on.
static Data[] nodeSingularData
          A list of singular node data
static LinkedList<Data> nodeSingularDataList
          A list of singular node data
static String[] nodeSingularDataStrings
          Strings used by the GUI to display node-singular data.
static NodeType[] nodeTypeArr
          An array of nodes.
static int NULL_CATEGORY
          The null category.
static String NULL_CHAR
          A null character.
static boolean panMoveDelayOn
          If true, panning continues if the mouse is released.
static boolean pauseGUI
          pause the GUI.
static float PLANE_PAN_X_MAX
          The maximum x-panning distance.
static float PLANE_PAN_Y_MAX
          The maximum y-panning distance.
static float PLANE_ZOOM_DEFAULT
          The default zoom distance.
static float PLANE_ZOOM_MAX
          The maximum zoom distance.
static float PLANE_ZOOM_MIN
          The minimum allowed zooming distance.
static boolean printServerMessages
          If true, server messages are printed to the console.
static float[] redColor
          Red.
static Hashtable<String,Integer> relID
          A hashtable containing an ID, hostname pair.
static Data[] relsData
          A list of data tied to relations.
static LinkedList<Data> relsDataList
          A list of data tied to relations.
static String[] relsDataStrings
          Strings used by the GUI to display relation data.
static boolean shiftPressed
          If shift is pressed.
static boolean skyboxOn
          True if the skybox is turned on.
static boolean skyboxRotationOn
          Automatic skybox rotation.
static Texture skyboxTexBottom
          Skybox texture.
static Texture skyboxTexSide1
          Skybox texture.
static Texture skyboxTexSide2
          Skybox texture.
static Texture skyboxTexSide3
          Skybox texture.
static Texture skyboxTexSide4
          Skybox texture.
static Texture skyboxTexTop
          Skybox texture.
static int socketBufferSize
          The size of the socket input buffer size.
static String SPACE
          A space character.
static float SPEED_DECAY_ROT
          Controls the decay rate of rotational movement.
static float SPEED_DECAY_TILT
          Controls the decay rate of tiliting movement.
static boolean startup
          If true, no prior initialization has ocurred
static boolean startupDialogRunning
          If true, the startup dialog is running.
static int STRAT_NODE_HOST_CAT_VALUE
          Parsing strategy.
static int STRAT_NODE_HOST_CAT_VALUE_N
          Parsing strategy.
static int STRAT_NODE_HOST_VALUE
          Parsing strategy.
static int STRAT_REL_HOST_VALUE
          Parsing strategy.
static int STRAT_REL_HOST_VALUE_2
          Parsing strategy.
static boolean texturesLoaded
          If true, the predefined textures are loaded.
static boolean tiltMoveDelayOn
          If true, tilting continues if the mouse is released.
static long timeOut
          If this value is set to zero, time out time is assumed to be infinite.
static int udpInPort
          The default port number used for incoming messages from the TIC.
static String udpOutHost
          The default host where the TIC listens for incoming messages.
static int udpOutPort
          The default port on which the TIC is assumed to listen for messages from the VI ynode
static String UNDERSCORE
          An underscore.
static int verticalSync
          Enable vertical sync.
private static int vid
          The latest ViewID.
static LinkedList<ViewPanel> viewList
          A list of view panels.
static int viewRefreshRate
          Suggested update frequenzy for the OpenGL rendering engine.
static float[] whiteColor
          White.
private static int wid
          The latest WindowID.
static LinkedList<GUI> windowList
          A list of top level windows.
static String windowTitle
          The default window title.
static Texture worldTex
          World map texture.
static float ZOOM_DECAY
          Controls the decay rate of the zoom.
 
Constructor Summary
VI()
           
 
Method Summary
static GraphNode[] cloneNodeArr()
          Clones an array of nodes.
static GraphNodeRel[] cloneNodeRelArr(GraphNode[] gNode)
          Clones an array of relations.
static void main(String[] args)
          Initialize the environment and start the GUI.
static float[] normalizedColor(float[] c1, float[] c2, float vn)
          Calculate the normalized color from a normalized value and a color range.
static void prepareDataStructures()
          Prepares all global data structures.
static void readSave(File file, ViewPanel view)
          Read a save file and load the settings into a view panel.
static void readTopologyFromFile(String fileName)
          Reads topology information from a file pointed to by the xml-file.
static int requestViewID()
          Request a new view ID.This method is thread safe.
static int requestWindowID()
          Request a new window ID.
static void writeSave(File file, ViewPanel view)
          Writes the viewsettings to file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

socketBufferSize

public static int socketBufferSize
The size of the socket input buffer size.


betterLightingOn

public static boolean betterLightingOn
Enables better lighting.


fogOn

public static boolean fogOn
True if fog is turned on.


barShadingOn

public static boolean barShadingOn
True if bar shading is turned on.


nodeShadingOn

public static boolean nodeShadingOn
True if node shading is turned on.


lineAAOn

public static boolean lineAAOn
True if line shading is turned on.


skyboxOn

public static boolean skyboxOn
True if the skybox is turned on.


build

private static final int build
The current buildnumber of this software. Used to identify if a savefile is compatible with the current build.

See Also:
Constant Field Values

startup

public static boolean startup
If true, no prior initialization has ocurred


startupDialogRunning

public static boolean startupDialogRunning
If true, the startup dialog is running.


DEFAULT_UDPIN_PORT

public static final int DEFAULT_UDPIN_PORT
The default port number used for incoming messages from the TIC.

See Also:
Constant Field Values

DEFAULT_UDPOUT_PORT

public static final int DEFAULT_UDPOUT_PORT
The default port on which the TIC is assumed to listen for messages from the VI ynode

See Also:
Constant Field Values

DEFAULT_UDPOUT_HOST

public static final String DEFAULT_UDPOUT_HOST
The default host where the TIC listens for incoming messages.

See Also:
Constant Field Values

udpInPort

public static int udpInPort
The default port number used for incoming messages from the TIC.


udpOutPort

public static int udpOutPort
The default port on which the TIC is assumed to listen for messages from the VI ynode


udpOutHost

public static String udpOutHost
The default host where the TIC listens for incoming messages.


keepAlivePort

public static int keepAlivePort
The default port on which the TIC is assumed to listen for messages from the VI ynode


keepAliveHost

public static String keepAliveHost
The default host where the TIC listens for incoming messages.


commandArr

public static Command[] commandArr
A list of commands.


leftArrowIcon

public static ImageIcon leftArrowIcon
An image.


downArrowIcon

public static ImageIcon downArrowIcon
An image.


brushOnIcon

public static ImageIcon brushOnIcon
An image.


brushOffIcon

public static ImageIcon brushOffIcon
An image.


windowTitle

public static String windowTitle
The default window title.


greyColor

public static final float[] greyColor
Grey (80%). As a 3f value.


whiteColor

public static final float[] whiteColor
White. As a 3f value.


redColor

public static final float[] redColor
Red. As a 3f value.


greenColor

public static final float[] greenColor
Green. As a 3f value.


blueColor

public static final float[] blueColor
Blue. As a 3f value.


GLOBE_MOVE_DELAY

public static final int GLOBE_MOVE_DELAY
The default dealy time (in tics) for "movement inertia"

See Also:
Constant Field Values

GLOBE_ZOOM_DEFAULT

public static final float GLOBE_ZOOM_DEFAULT
The default zoom distance.

See Also:
Constant Field Values

GLOBE_ZOOM_MAX

public static final float GLOBE_ZOOM_MAX
The maximum zoom distance. Note that the skybox is the limit. Get it? "sky is the limit"?

See Also:
Constant Field Values

GLOBE_ZOOM_MIN

public static final float GLOBE_ZOOM_MIN
The minimum allowed zooming distance.

See Also:
Constant Field Values

PLANE_ZOOM_DEFAULT

public static final float PLANE_ZOOM_DEFAULT
The default zoom distance.

See Also:
Constant Field Values

PLANE_ZOOM_MAX

public static final float PLANE_ZOOM_MAX
The maximum zoom distance. Note that the skybox is the limit. Get it? "sky is the limit"?

See Also:
Constant Field Values

PLANE_ZOOM_MIN

public static final float PLANE_ZOOM_MIN
The minimum allowed zooming distance.

See Also:
Constant Field Values

PLANE_PAN_X_MAX

public static final float PLANE_PAN_X_MAX
The maximum x-panning distance.

See Also:
Constant Field Values

PLANE_PAN_Y_MAX

public static final float PLANE_PAN_Y_MAX
The maximum y-panning distance.

See Also:
Constant Field Values

ZOOM_DECAY

public static final float ZOOM_DECAY
Controls the decay rate of the zoom.

See Also:
Constant Field Values

SPEED_DECAY_ROT

public static final float SPEED_DECAY_ROT
Controls the decay rate of rotational movement.

See Also:
Constant Field Values

SPEED_DECAY_TILT

public static final float SPEED_DECAY_TILT
Controls the decay rate of tiliting movement.

See Also:
Constant Field Values

GLOBE_TILT_ANGLE_DEFAULT

public static final float GLOBE_TILT_ANGLE_DEFAULT
The default tilt-angle.

See Also:
Constant Field Values

GLOBE_ROT_ANGLE_DEFAULT

public static final float GLOBE_ROT_ANGLE_DEFAULT
The default rot-angle.

See Also:
Constant Field Values

tiltMoveDelayOn

public static boolean tiltMoveDelayOn
If true, tilting continues if the mouse is released.


panMoveDelayOn

public static boolean panMoveDelayOn
If true, panning continues if the mouse is released.


ignoreShift

public static boolean ignoreShift
If true, panning and tilting is not separated.


infiniteMoveDelayOn

public static boolean infiniteMoveDelayOn
If true, tilting continues for eternity.


pauseGUI

public static boolean pauseGUI
pause the GUI.


globeRotationOn

public static boolean globeRotationOn
Automatic globe rotation.


skyboxRotationOn

public static boolean skyboxRotationOn
Automatic skybox rotation.


shiftPressed

public static boolean shiftPressed
If shift is pressed.


mPressed

public static boolean mPressed
If m-key is pressed.


focusInView

public static boolean focusInView
If focus is in view.


globeViewOn

public static boolean globeViewOn
If globe view is on.


brushingOn

public static boolean brushingOn
If brushing is on.


brushedCategory

public static int brushedCategory

BRUSHING_PRIMARY_COLOR_DEFAULT

public static final Color BRUSHING_PRIMARY_COLOR_DEFAULT
The primary brushing color.


BRUSHING_SECONDARY_COLOR_DEFAULT

public static final Color BRUSHING_SECONDARY_COLOR_DEFAULT
The secondary brushing color.


BRUSHING_OFF_COLOR_DEFAULT

public static final Color BRUSHING_OFF_COLOR_DEFAULT
Brushing Suppressed color.


brushingPrimaryColor

public static Color brushingPrimaryColor
The primary brushing color.


brushingSecondaryColor

public static Color brushingSecondaryColor
The secondary brushing color.


brushingOffColor

public static Color brushingOffColor
Brushing Suppressed color.


viewRefreshRate

public static int viewRefreshRate
Suggested update frequenzy for the OpenGL rendering engine.


verticalSync

public static int verticalSync
Enable vertical sync.


coreRunning

public static boolean coreRunning
If true, the core is running.


printServerMessages

public static boolean printServerMessages
If true, server messages are printed to the console.


viewList

public static LinkedList<ViewPanel> viewList
A list of view panels.


consoleList

public static LinkedList<ConsolePanel> consoleList
A list of console panels.


windowList

public static LinkedList<GUI> windowList
A list of top level windows.


nodeList

public static LinkedList<GraphNode> nodeList
A list of graph nodes.


nodeArr

public static GraphNode[] nodeArr
A list of graph nodes as an array.


nodeRelList

public static LinkedList<GraphNodeRel> nodeRelList
A list of node relations.


nodeRelArr

public static GraphNodeRel[] nodeRelArr
A list of node relations as an array.


categoryList

public static LinkedList<Category> categoryList
A list of categories as an array.


categoryArr

public static Category[] categoryArr
A list of categories.


dataArr

public static Data[] dataArr
A list of data


nodeSingularDataList

public static LinkedList<Data> nodeSingularDataList
A list of singular node data


nodeMultiDataList

public static LinkedList<Data> nodeMultiDataList
A list of multidimensional node data


relsDataList

public static LinkedList<Data> relsDataList
A list of data tied to relations.


nodeSingularData

public static Data[] nodeSingularData
A list of singular node data


nodeMultiData

public static Data[] nodeMultiData
A list of multidimensional node data


relsData

public static Data[] relsData
A list of data tied to relations.


nodeSingularDataStrings

public static String[] nodeSingularDataStrings
Strings used by the GUI to display node-singular data.


nodeMultiDataStrings

public static String[] nodeMultiDataStrings
Strings used by the GUI to display node-multideimensional data.


relsDataStrings

public static String[] relsDataStrings
Strings used by the GUI to display relation data.


nodeID

public static Hashtable<String,Integer> nodeID
A hashtable containing an ID, hostname pair.


relID

public static Hashtable<String,Integer> relID
A hashtable containing an ID, hostname pair.


catID

public static Hashtable<String,Integer> catID
A hashtable containing an ID, hostname pair.


dataID

public static Hashtable<String,Integer> dataID
A hashtable containing an ID, data set name pair.


wid

private static int wid
The latest WindowID.


vid

private static int vid
The latest ViewID.


worldTex

public static Texture worldTex
World map texture.


blankTex

public static Texture blankTex
World map texture.


skyboxTexTop

public static Texture skyboxTexTop
Skybox texture.


skyboxTexBottom

public static Texture skyboxTexBottom
Skybox texture.


skyboxTexSide1

public static Texture skyboxTexSide1
Skybox texture.


skyboxTexSide2

public static Texture skyboxTexSide2
Skybox texture.


skyboxTexSide3

public static Texture skyboxTexSide3
Skybox texture.


skyboxTexSide4

public static Texture skyboxTexSide4
Skybox texture.


texturesLoaded

public static boolean texturesLoaded
If true, the predefined textures are loaded.


CONSOLE_INPUT_CAPACITY

public static final int CONSOLE_INPUT_CAPACITY
The size of the console input buffer

See Also:
Constant Field Values

MESSAGE_MAX_WIDTH

public static final int MESSAGE_MAX_WIDTH
The maximum size of incoming messages.

See Also:
Constant Field Values

consoleInputBuffer

public static RawBuffer consoleInputBuffer
A buffer used for storing user input messages.


d

public static ConsolePanel d
The console. Use VI.d.d("debug"); to print text.


STRAT_NODE_HOST_VALUE

public static int STRAT_NODE_HOST_VALUE
Parsing strategy.


STRAT_NODE_HOST_CAT_VALUE

public static int STRAT_NODE_HOST_CAT_VALUE
Parsing strategy.


STRAT_NODE_HOST_CAT_VALUE_N

public static int STRAT_NODE_HOST_CAT_VALUE_N
Parsing strategy.


STRAT_REL_HOST_VALUE

public static int STRAT_REL_HOST_VALUE
Parsing strategy.


STRAT_REL_HOST_VALUE_2

public static int STRAT_REL_HOST_VALUE_2
Parsing strategy.


NULL_CATEGORY

public static int NULL_CATEGORY
The null category.


SPACE

public static final String SPACE
A space character.

See Also:
Constant Field Values

UNDERSCORE

public static final String UNDERSCORE
An underscore.

See Also:
Constant Field Values

NULL_CHAR

public static final String NULL_CHAR
A null character.

See Also:
Constant Field Values

currentTimeStamp

public static long currentTimeStamp
The current time.


timeOut

public static long timeOut
If this value is set to zero, time out time is assumed to be infinite.


defaultValue

public static float defaultValue
The default value used for the timeout.


barType

public static int barType
The current bar type.


nodeTypeArr

public static NodeType[] nodeTypeArr
An array of nodes.

Constructor Detail

VI

public VI()
Method Detail

normalizedColor

public static float[] normalizedColor(float[] c1,
                                      float[] c2,
                                      float vn)
Calculate the normalized color from a normalized value and a color range. Note: Uses linear scaling.

Parameters:
c1 - A color RGB triple. Start color of the gradient.
c2 - A color RGB triple. End color of the gradient.
vn - A normalized value in the range [0.0 1.0].
Returns:
the normalized color.

requestWindowID

public static int requestWindowID()
Request a new window ID. This method is thread safe.

Returns:
The requested window ID.

requestViewID

public static int requestViewID()
Request a new view ID.This method is thread safe.

Returns:
The requested view ID.

readSave

public static void readSave(File file,
                            ViewPanel view)
Read a save file and load the settings into a view panel.

Parameters:
file - A save file.
view - A view panel.

writeSave

public static void writeSave(File file,
                             ViewPanel view)
Writes the viewsettings to file.

Parameters:
file - a file to write to.
view - a view.

readTopologyFromFile

public static void readTopologyFromFile(String fileName)
Reads topology information from a file pointed to by the xml-file. The file should have the following formatting:
 C
 nodeID nodeTypeID nodeTypeName nodeHierarchyName Xpos Ypos
 ...
 relationID nodeAID nodeBID
 ...
 
 Example:
 
 1
 1 1 xnode 11b 0.4 1.102
 2 2 ynode 11b 0.11 -0.3
 rID 1 2
 


prepareDataStructures

public static void prepareDataStructures()
Prepares all global data structures.


cloneNodeArr

public static GraphNode[] cloneNodeArr()
Clones an array of nodes.

Returns:
An array of nodes.

cloneNodeRelArr

public static GraphNodeRel[] cloneNodeRelArr(GraphNode[] gNode)
Clones an array of relations.

Parameters:
gNode - An array of nodes.
Returns:
An array of relations.

main

public static void main(String[] args)
Initialize the environment and start the GUI.

Parameters:
args - Not used.