VirtualLabBuilder.src.Functions

Functions for java code generation and other functions used by the classes contained in the ViewElements package

Information


 

Functions package

Functions package includes the following Modelica functions:

Package Content

NameDescription
VirtualLabBuilder.src.Functions.signalFile signalFile First lines of the java file
VirtualLabBuilder.src.Functions.frame frame Write the java code to generate a MainFrame
VirtualLabBuilder.src.Functions.dialog dialog Write the java code to generate a dialog window
VirtualLabBuilder.src.Functions.drawingPanel drawingPanel Write the java code to generate a DrawingPanel
VirtualLabBuilder.src.Functions.panel panel Write the java code to generate a Panel
VirtualLabBuilder.src.Functions.fPolygon fPolygon Write the java code to generate a Polygon
VirtualLabBuilder.src.Functions.radioButton radioButton Write the java code to generate a RadioButton
VirtualLabBuilder.src.Functions.slider slider Write the java code to generate a Slider
VirtualLabBuilder.src.Functions.label label Write the java code to generate a Label
VirtualLabBuilder.src.Functions.bodyGUI bodyGUI Last lines of the java file
VirtualLabBuilder.src.Functions.fOval fOval Write the java code to generate an oval
VirtualLabBuilder.src.Functions.Sum Sum Adding the components of a vector
VirtualLabBuilder.src.Functions.text text Write the java code to generate a Text
VirtualLabBuilder.src.Functions.arrow arrow Write the java code to generate an Arrow
VirtualLabBuilder.src.Functions.plottingPanel plottingPanel Write the java code to generate a PlottingPanel
VirtualLabBuilder.src.Functions.trail trail Write the java code to generate a Frame
VirtualLabBuilder.src.Functions.checkBox checkBox Write the java code to generate a CheckBox
VirtualLabBuilder.src.Functions.spring spring Write the Java code to generate a Spring
VirtualLabBuilder.src.Functions.damper damper Write the Java code to generate a Damper
VirtualLabBuilder.src.Functions.pauseButton pauseButton Write the Java code to generate a PauseButton
VirtualLabBuilder.src.Functions.numberField numberField Write the Java code to generate a NumberField
VirtualLabBuilder.src.Functions.infoButton infoButton Write the Java code to generate an InfoButton
VirtualLabBuilder.src.Functions.button1Action button1Action Write the Java code to generate a Button1Action
VirtualLabBuilder.src.Functions.button2Actions button2Actions Write the Java code to generate a Button2Actions
VirtualLabBuilder.src.Functions.processingFile processingFile Reads the number written in the first line of a file. Then, writes the number read incremented by one


VirtualLabBuilder.src.Functions.signalFile

First lines of the java file

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
IntegerserverPort Number of the server port

Outputs

TypeNameDescription
Integero 

Modelica definition

function signalFile "First lines of the java file" 
  input String fileName "Name of the Java file";
  input Integer serverPort "Number of the server port";
  output Integer o;
  
  external "C";
end signalFile;

VirtualLabBuilder.src.Functions.frame

Write the java code to generate a MainFrame

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringname Name of the component
Stringtitle Text displayed as title
IntegerxPosition X coordinate of the window upper left corner in pixels
IntegeryPosition Y coordinate of the window upper left corner in pixels
Integersize[2] Size of the window in pixels
StringLayoutPolicy Layout policy of the element

Modelica definition

function frame "Write the java code to generate a MainFrame" 
  input String fileName "Name of the Java file";
  input String name "Name of the component";
  input String title "Text displayed as title";
  input Integer xPosition 
    "X coordinate of the window upper left corner in pixels";
  input Integer yPosition 
    "Y coordinate of the window upper left corner in pixels";
  input Integer size[2] "Size of the window in pixels";
  input String LayoutPolicy "Layout policy of the element";
  external "C";
end frame;

VirtualLabBuilder.src.Functions.dialog

Write the java code to generate a dialog window

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringname Name of the component
Stringtitle Text displayed as title
IntegerxPosition X coordinate of the window upper left corner in pixels
IntegeryPosition Y coordinate of the window upper left corner in pixels
Integersize[2] Size of the window in pixels
StringvarName String associated to a check-box
StringLayoutPolicy Layout policy

Modelica definition

function dialog "Write the java code to generate a dialog window" 
  input String fileName "Name of the Java file";
  input String name "Name of the component";
  input String title "Text displayed as title";
  input Integer xPosition 
    "X coordinate of the window upper left corner in pixels";
  input Integer yPosition 
    "Y coordinate of the window upper left corner in pixels";
  input Integer size[2] "Size of the window in pixels";
  input String varName "String associated to a check-box";
  input String LayoutPolicy "Layout policy";
  external "C";
end dialog;

VirtualLabBuilder.src.Functions.drawingPanel

Write the java code to generate a DrawingPanel

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringparent Name of the component hosting the element
Stringname Name of the element
Realsize[4] {Minimum X, Maximum X, Minimum Y, Maximum Y
IntegerpositionSelection 1: the container hosting the element has BorderLayout policy
Stringposition Position in the container hosting the element

Modelica definition

function drawingPanel 
  "Write the java code to generate a DrawingPanel" 
  input String fileName "Name of the Java file";
  input String parent "Name of the component hosting the element";
  input String name "Name of the element";
  input Real size[4] "{Minimum X, Maximum X, Minimum Y, Maximum Y";
  input Integer positionSelection 
    "1: the container hosting the element has BorderLayout policy";
  input String position "Position in the container hosting the element";
  
  external "C";
end drawingPanel;

VirtualLabBuilder.src.Functions.panel

Write the java code to generate a Panel

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringparent Name of the component hosting the element
Stringname Name of the element
IntegerpositionSelection 1: the container hosting the element has BorderLayout policy
Stringposition Position in the container hosting the element
Stringlayout Layout policy

Modelica definition

function panel "Write the java code to generate a Panel" 
  input String fileName "Name of the Java file";
  input String parent "Name of the component hosting the element";
  input String name "Name of the element";
  input Integer positionSelection 
    "1: the container hosting the element has BorderLayout policy";
  input String position "Position in the container hosting the element";
  input String layout "Layout policy";
  
  external "C";
end panel;

VirtualLabBuilder.src.Functions.fPolygon

Write the java code to generate a Polygon

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringparent Name of the component hosting the element
Stringname Name of the element
Stringnum Number identifying the component in the virtual-lab view description
RealVertexesX[:] X-coordinate of the polygon vertexes
RealVertexesY[:] X-coordinate of the polygon vertexes
IntegernumberVertexes Number of vertexes
Stringfilled True: filled, false: not filled
IntegerlineColor[4] Color of the line
IntegerfillColor[4] Color of the filling
Stringclosed True: the fist and last point are connected by a line
IntegerintVertexesX[:] intVertexesX[i] = 1 if coordinate x of vertex i changes in time
IntegerintVertexesY[:] intVertexesY[i] = 1 if coordinate y of vertex i changes in time
IntegerintLineColor 1 if the line color change in time and 0 otherwise
IntegerintFillColor 1 if the filling color change in time and 0 otherwise
Realstroke Stroke used to draw the lines
Integergradient 1 if there is a gradient in the filling color
Realp1[2] Position where the color gradient starts
Integercolor1[4] Color at point p1
Realp2[2] Position where the color gradient finishes
Integercolor2[4] Color at point p2
Stringcyclic True if the color gradient is cyclic

Modelica definition

function fPolygon "Write the java code to generate a Polygon" 
  input String fileName "Name of the Java file";
  input String parent "Name of the component hosting the element";
  input String name "Name of the element";
  input String num 
    "Number identifying the component in the virtual-lab view description";
  input Real VertexesX[:] "X-coordinate of the polygon vertexes";
  input Real VertexesY[:] "X-coordinate of the polygon vertexes";
  input Integer numberVertexes "Number of vertexes";
  input String filled "True: filled, false: not filled";
  input Integer lineColor[4] "Color of the line";
  input Integer fillColor[4] "Color of the filling";
  input String closed "True: the fist and last point are connected by a line";
  input Integer intVertexesX[:] 
    "intVertexesX[i] = 1 if coordinate x of vertex i changes in time";
  input Integer intVertexesY[:] 
    "intVertexesY[i] = 1 if coordinate y of vertex i changes in time";
  input Integer intLineColor 
    "1 if the line color change in time and 0 otherwise";
  input Integer intFillColor 
    "1 if the filling color change in time and 0 otherwise";
  input Real stroke "Stroke used to draw the lines";
  input Integer gradient "1 if there is a gradient in the filling color";
  input Real p1[2] "Position where  the color gradient starts";
  input Integer color1[4] "Color at point p1";
  input Real p2[2] "Position where the color gradient finishes";
  input Integer color2[4] "Color at point p2";
  input String cyclic "True if the color gradient is cyclic";
  
    external "C";
end fPolygon;

VirtualLabBuilder.src.Functions.radioButton

Write the java code to generate a RadioButton

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringname Name of the element
Stringparent Name of the component hosting the element
StringbuttonValue"true"Initial value
Integerindex Number identifying the interactive element
Stringtext Text displayed by the element
StringbuttonGroup The radio-button belongs to this group
IntegerpositionSelection 1: the container hosting the element has BorderLayout policy
StringpositionInBorderLayout Position in the container hosting the element

Modelica definition

function radioButton "Write the java code to generate a RadioButton" 
  input String fileName "Name of the Java file";
  input String name "Name of the element";
  input String parent "Name of the component hosting the element";
  input String buttonValue = "true" "Initial value";
  input Integer index "Number identifying the interactive element";
  input String text "Text displayed by the element";
  input String buttonGroup "The radio-button belongs to this group";
  input Integer positionSelection 
    "1: the container hosting the element has BorderLayout policy";
  input String positionInBorderLayout 
    "Position in the container hosting the element";
  
   external "C";
end radioButton;

VirtualLabBuilder.src.Functions.slider

Write the java code to generate a Slider

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringname Name of the element
Stringparent Name of the container hosting the element
RealinitialValue Initial value
StringstringFormat Format of the text displayed by the component
StringtickFormat Format of the text displayed with the ticks
IntegertickNumber Number of ticks
Realminimum Minimum value of the variable linked to the component
Realmaximum Maximum value of the variable linked to the component
Realfactor Scale factor
Stringenable 1: enabled, 0: disabled
Integerposition Number identifying the interactive element
IntegerpositionSelection 1: the container hosting the element has BorderLayout policy
StringpositionInBorderLayout Position in the container hosting the element

Modelica definition

function slider "Write the java code to generate a Slider" 
  input String fileName "Name of the Java file";
  input String name "Name of the element";
  input String parent "Name of the container hosting the element";
  input Real initialValue "Initial value";
  input String stringFormat "Format of the text displayed by the component";
  input String tickFormat "Format of the text displayed with the ticks";
  input Integer tickNumber "Number of ticks";
  input Real minimum "Minimum value of the variable linked to the component";
  input Real maximum "Maximum value of the variable linked to the component";
  input Real factor "Scale factor";
  input String enable "1: enabled, 0: disabled";
  input Integer position "Number identifying the interactive element";
  input Integer positionSelection 
    "1: the container hosting the element has BorderLayout policy";
  input String positionInBorderLayout 
    "Position in the container hosting the element";
  
  external "C";
end slider;

VirtualLabBuilder.src.Functions.label

Write the java code to generate a Label

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringname Name of the element
Stringparent Name of the container hosting the element
Stringtext Text to be displayed
Stringalignment Alignment of the text
Integerbackground[4] Background color
Integerforeground[4] Foreground color
StringtypeFont Type of font of the text
StringstyleFont Style of font of the text
IntegersizeFont Size of font
IntegerpositionSelection 1: the container hosting the element has BorderLayout policy
StringpositionInBorderLayout Position in the container hosting the element

Modelica definition

function label "Write the java code to generate a Label" 
  input String fileName "Name of the Java file";
  input String name "Name of the element";
  input String parent "Name of the container hosting the element";
  input String text "Text to be displayed";
  input String alignment "Alignment of the text";
  input Integer background[4] "Background color";
  input Integer foreground[4] "Foreground color";
  input String typeFont "Type of font of the text";
  input String styleFont "Style of font of the text";
  input Integer sizeFont "Size of font";
  input Integer positionSelection 
    "1: the container hosting the element has BorderLayout policy";
  input String positionInBorderLayout 
    "Position in the container hosting the element";
  
  external "C";
end label;

VirtualLabBuilder.src.Functions.bodyGUI

Last lines of the java file

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file

Modelica definition

function bodyGUI "Last lines of the java file" 
  input String fileName "Name of the Java file";
  
  external "C";
end bodyGUI;

VirtualLabBuilder.src.Functions.fOval

Write the java code to generate an oval

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringparent Name of the component hosting the element
Stringname Name of the element
Stringnum Number identifying the element
RealCenter[2] Position of the oval center
RealAxes[2] Length of the oval axes
Stringfilled True: filled, false: not filled
IntegerlineColor[4] Color of the line
IntegerfillColor[4] Color of the filling
IntegerintCenter 1: center position changes
IntegerintAxes 1: axes length change
IntegerintLineColor 1 if the line color change in time and 0 otherwise
IntegerintFillColor 1 if the line color change in time and 0 otherwise
Realstroke Stroke used to draw the lines
Integergradient 1 if there is a gradient in the filling color
Realp1[2] Position where the color gradient starts
Integercolor1[4] Color at point p1
Realp2[2] Position where the color gradient finishes
Integercolor2[4] Color at point p2
Stringcyclic True if the color gradient is cyclic

Modelica definition

function fOval "Write the java code to generate an oval" 
  input String fileName "Name of the Java file";
  input String parent "Name of the component hosting the element";
  input String name "Name of the element";
  input String num "Number identifying the element";
  input Real Center[2] "Position of the oval center";
  input Real Axes[2] "Length of the oval axes";
  
  input String filled "True: filled, false: not filled";
  input Integer lineColor[4] "Color of the line";
  input Integer fillColor[4] "Color of the filling";
  input Integer intCenter "1: center position changes";
  input Integer intAxes "1: axes length change";
  input Integer intLineColor 
    "1 if the line color change in time and 0 otherwise";
  input Integer intFillColor 
    "1 if the line color change in time and 0 otherwise";
  input Real stroke "Stroke used to draw the lines";
  input Integer gradient "1 if there is a gradient in the filling color";
  input Real p1[2] "Position where  the color gradient starts";
  input Integer color1[4] "Color at point p1";
  input Real p2[2] "Position where the color gradient finishes";
  input Integer color2[4] "Color at point p2";
  input String cyclic "True if the color gradient is cyclic";
  
  external "C";
end fOval;

VirtualLabBuilder.src.Functions.Sum

Adding the components of a vector

Inputs

TypeNameDefaultDescription
IntegerA[:] Vector

Outputs

TypeNameDescription
IntegerResultResult

Modelica definition

function Sum "Adding the components of a vector" 
  input Integer A[:] "Vector";
  output Integer Result "Result";
algorithm 
  Result :=0;
  for i in 1:size(A,1) loop
    Result := Result + A[i];
  end for;
end Sum;

VirtualLabBuilder.src.Functions.text

Write the java code to generate a Text

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringparent Name of the component hosting the element
Stringname Name of the element
Stringnum Number identifying the element
RealCenter[2] Position of the string center
IntegertextColor[4] Color of the string
StringtextString Text displayed by the string
IntegerintCenter 1: the string center changes in time

Modelica definition

function text "Write the java code to generate a Text" 
  input String fileName "Name of the Java file";
  input String parent "Name of the component hosting the element";
  input String name "Name of the element";
  input String num "Number identifying the element";
  input Real Center[2] "Position of the string center";
  input Integer textColor[4] "Color of the string";
  input String textString "Text displayed by the string";
  input Integer intCenter "1: the string center changes in time";
  
    external "C";
end text;

VirtualLabBuilder.src.Functions.arrow

Write the java code to generate an Arrow

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringparent Name of the container hosting the element
Stringname Name of the element
Stringnum Number identifying the component
RealOrigin[2] Origin of the vector
RealLength[2] x and y component of the vector
Integercolor[4] Color of the arrow
IntegerintOrigin 1: the origin changes in time
IntegerintLength 1: the components of the vector changes in time
Realstroke Stroke of the line
IntegerintStroke 1: the stroke changes in time

Modelica definition

function arrow "Write the java code to generate an Arrow" 
  input String fileName "Name of the Java file";
  input String parent "Name of the container hosting the element";
  input String name "Name of the element";
  input String num "Number identifying the component";
  input Real Origin[2] "Origin of the vector";
  input Real Length[2] "x and y component of the vector";
  input Integer color[4] "Color of the arrow";
  input Integer intOrigin "1: the origin changes in time";
  input Integer intLength "1: the components of the vector changes in time";
  input Real stroke "Stroke of the line";
  input Integer intStroke "1: the stroke changes in time";
  external "C";
  
end arrow;

VirtualLabBuilder.src.Functions.plottingPanel

Write the java code to generate a PlottingPanel

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringparent Name of the component hosting the element
Stringname Name of the element
Stringtitle Title to display at the top
Stringfont_name Title font
Integerfont_size Size of the title font
Stringfont_style Style of the title font
StringaxesType The type of axis to be displayed
StringtitleX Label of the x axis
StringxAxisType The type (linear or log) for cartesian X axis
StringgridX Whether to display the grid for the x axis
StringtitleY Label of the y axis
StringyAxisType The type (linear or log) for cartesian Y axis
StringgridY Whether to display the grid for the y axis
RealdeltaR The separation in R for the polar axis
RealdeltaTheta The separation in Theta for polar axis
StringautoScaleX Whether to automatically adjust X scale
RealmarginX Margin to be left in the X scale
StringautoScaleY Whether to automatically adjust Y scale
RealmarginY Margin to be left in the Y scale
RealminX The minimum x value that can be displayed
RealmaxX The maximum x value that can be displayed
RealminY The minimum y value that can be displayed
RealmaxY The maximum y valued taht can be displayed
Stringcoordinates Whether to display coordinates when the mouse is pressed
StringshowGrid Whether to show or not the grid
IntegerpositionSelection 1: the container hosting the element has BorderLayout policy
Stringposition Position in the container hosting the element

Modelica definition

function plottingPanel 
  "Write the java code to generate a PlottingPanel" 
  input String fileName "Name of the Java file";
  input String parent "Name of the component hosting the element";
  input String name "Name of the element";
  input String title "Title to display at the top";
  input String font_name "Title font";
  input Integer font_size "Size of the title font";
  input String font_style "Style of the title font";
  input String axesType "The type of axis to be displayed";
  input String titleX "Label of the x axis";
  input String xAxisType "The type (linear or log) for cartesian X axis";
  input String gridX "Whether to display the grid for the x axis";
  input String titleY "Label of the y axis";
  input String yAxisType "The type (linear or log) for cartesian Y axis";
  input String gridY "Whether to display the grid for the y axis";
  input Real deltaR "The separation in R for the polar axis";
  input Real deltaTheta "The separation in Theta for polar axis";
  input String autoScaleX "Whether to automatically adjust X scale";
  input Real marginX "Margin to be left in the X scale";
  input String autoScaleY "Whether to automatically adjust Y scale";
  input Real marginY "Margin to be left in the Y scale";
  input Real minX "The minimum x value that can be displayed";
  input Real maxX "The maximum x value that can be displayed";
  input Real minY "The minimum y value that can be displayed";
  input Real maxY "The maximum y valued taht can be displayed";
  input String coordinates 
    "Whether to display coordinates when the mouse is pressed";
  
  input String showGrid "Whether to show or not the grid";
  input Integer positionSelection 
    "1: the container hosting the element has BorderLayout policy";
  input String position "Position in the container hosting the element";
  
  external "C";
end plottingPanel;

VirtualLabBuilder.src.Functions.trail

Write the java code to generate a Frame

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringparent Name of the container hosting the element
Stringname Name of the element
Stringnum Number identifying the element
Realpoint[2] Coordinates x and y of the new point
IntegermaximumPoints Maximum number of points to be displayed
IntegernSkip Number of points to skip before plotting one
Stringconnected Whether to connect next point with the previous
IntegerlineColor[4] Color of the line

Modelica definition

function trail "Write the java code to generate a Frame" 
  input String fileName "Name of the Java file";
  input String parent "Name of the container hosting the element";
  input String name "Name of the element";
  input String num "Number identifying the element";
  input Real point[2] "Coordinates x and y of the new point";
  input Integer maximumPoints "Maximum number of points to be displayed";
  input Integer nSkip "Number of points to skip before plotting one";
  input String connected "Whether to connect next point with the previous";
  input Integer lineColor[4] "Color of the line";
  
   external "C";
end trail;

VirtualLabBuilder.src.Functions.checkBox

Write the java code to generate a CheckBox

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringname Name of the element
Stringparent Name of the container hosting the element
StringinitialValue Initial value
Stringlabel Text displayed with the checkBox
StringvarName String variable that can be linked to the corresponding variable of a dialog window in order to show and hide the window by clicking on the check-box
IntegerpositionSelection 1: the container hosting the element has BorderLayout policy
StringpositionInBorderLayout Position in the container hosting the element

Modelica definition

function checkBox "Write the java code to generate a CheckBox" 
  input String fileName "Name of the Java file";
  input String name "Name of the element";
  input String parent "Name of the container hosting the element";
  input String initialValue "Initial value";
  input String label "Text displayed with the checkBox";
  input String varName 
    "String variable that can be linked to the corresponding variable of a dialog window in order to show and hide the window by clicking on the check-box";
  input Integer positionSelection 
    "1: the container hosting the element has BorderLayout policy";
  input String positionInBorderLayout 
    "Position in the container hosting the element";
  
  external "C";
end checkBox;

VirtualLabBuilder.src.Functions.spring

Write the Java code to generate a Spring

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringparent Name of the component hosting the element
Stringname Name of the element
Stringnum Number identifying the element
Reald Drawing Parameter
IntegerN Drawing Parameter
RealA Drawing Parameter
Realstroke Stroke of the line
Realx1 X- Coordinate of P1. P1 is one spring extremity
Realx2 X- Coordinate of P2. P2 is one spring extremity
Realy1 Y- Coordinate of P1. P1 is one spring extremity
Realy2 Y- Coordinate of P2. P2 is one spring extremity
IntegerintX1Y1 = 0 if the point (x1, y1) change in time and 0 otherwise
IntegerintX2Y2 = 0 if the point (x2, y2) change in time and 0 otherwise
IntegerlineColor[4] Line color

Modelica definition

function spring "Write the Java code to generate a Spring" 
  input String fileName "Name of the Java file";
  input String parent "Name of the component hosting the element";
  input String name "Name of the element";
  input String num "Number identifying the element";
  input Real d "Drawing Parameter";
  input Integer N "Drawing Parameter";
  input Real A "Drawing Parameter";
  input Real stroke "Stroke of the line";
  input Real x1 "X- Coordinate of P1. P1 is one spring extremity";
  input Real x2 "X- Coordinate of P2. P2 is one spring extremity";
  input Real y1 "Y- Coordinate of P1. P1 is one spring extremity";
  input Real y2 "Y- Coordinate of P2. P2 is one spring extremity";
  input Integer intX1Y1 
    "= 0 if the point (x1, y1) change in time and 0 otherwise ";
  input Integer intX2Y2 
    "= 0 if the point (x2, y2) change in time and 0 otherwise ";
  input Integer lineColor[4] "Line color";
  
    external "C";
end spring;

VirtualLabBuilder.src.Functions.damper

Write the Java code to generate a Damper

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringparent Name of the container hosting the element
Stringname Name of the element
Stringnum Number identifying the element
Reald Drawing parameter
RealL1 Drawing parameter
RealL2 Drawing parameter
Realx1 X- Coordinate of P1. P1 is one spring extremity
Realx2 X- Coordinate of P2. P2 is one spring extremity
Realy1 Y- Coordinate of P1. P1 is one spring extremity
Realy2 Y- Coordinate of P2. P2 is one spring extremity
IntegerintX1Y2 = 0 if the point (x1, y1) change in time and 0 otherwise
IntegerintX2Y2 = 0 if the point (x2, y2) change in time and 0 otherwise
Integercolor1[4] The damper color changes form this color to color2
Integercolor2[4] The damper color changes form this color to color1

Modelica definition

function damper "Write the Java code to generate a Damper" 
 input String fileName "Name of the Java file";
  input String parent "Name of the container hosting the element";
  input String name "Name of the element";
  input String num "Number identifying the element";
  input Real d "Drawing parameter";
  input Real L1 "Drawing parameter";
  input Real L2 "Drawing parameter";
  input Real x1 "X- Coordinate of P1. P1 is one spring extremity";
  input Real x2 "X- Coordinate of P2. P2 is one spring extremity";
  input Real y1 "Y- Coordinate of P1. P1 is one spring extremity";
  input Real y2 "Y- Coordinate of P2. P2 is one spring extremity";
  input Integer intX1Y2 
    "= 0 if the point (x1, y1) change in time and 0 otherwise ";
  input Integer intX2Y2 
    "= 0 if the point (x2, y2) change in time and 0 otherwise ";
  input Integer color1[4] "The damper color changes form this color to color2";
  input Integer color2[4] "The damper color changes form this color to color1";
  
    external "C";
end damper;

VirtualLabBuilder.src.Functions.pauseButton

Write the Java code to generate a PauseButton

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringname Name of the element
Stringparent Name of the component hosting the element
StringbuttonValue"true"Initial value
IntegerpositionSelection 1: the container hosting the element has BorderLayout policy
StringpositionInBorderLayout Position in the container hosting the element

Modelica definition

function pauseButton "Write the Java code to generate a PauseButton" 
  input String fileName "Name of the Java file";
  input String name "Name of the element";
  input String parent "Name of the component hosting the element";
  input String buttonValue = "true" "Initial value";
  input Integer positionSelection 
    "1: the container hosting the element has BorderLayout policy";
  input String positionInBorderLayout 
    "Position in the container hosting the element";
   external "C";
end pauseButton;

VirtualLabBuilder.src.Functions.numberField

Write the Java code to generate a NumberField

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringname Name of the element
Stringparent Name of the container hosting the elemnt
RealinitialValue Initial value
StringstringFormat Format of the number
Stringenable 1: enable, 0: disabled
Integerposition Number identifying the interactive element
IntegerpositionSelection 1: the container hosting the element has BorderLayout policy
StringpositionInBorderLayout Position in the container hosting the element

Modelica definition

function numberField "Write the Java code to generate a NumberField" 
  input String fileName "Name of the Java file";
  input String name "Name of the element";
  input String parent "Name of the container hosting the elemnt";
  input Real initialValue "Initial value";
  input String stringFormat "Format of the number";
  
  input String enable "1: enable, 0: disabled";
  input Integer position "Number identifying the interactive element";
  input Integer positionSelection 
    "1: the container hosting the element has BorderLayout policy";
  input String positionInBorderLayout 
    "Position in the container hosting the element";
  
  external "C";
end numberField;

VirtualLabBuilder.src.Functions.infoButton

Write the Java code to generate an InfoButton

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringname Name of the element
Stringparent Name of the container hosting the elment
Stringselected"true"Initial value
Stringlabel Text displayed with the element
Stringalignment Alignment of the text
Stringimage Path of the image
Integerbgcolor[4] Background color
Stringtooltip Text of the tooltip
Integerlettercolor[4] Color of the text
StringtypeFont Type of font
StringstyleFont Style of font
IntegersizeFont Size of font
Stringpath Path of the HTML pages
IntegerxPos X coordinate of the window upper left corner in pixels
IntegeryPos Y coordinate of the window upper left corner in pixels
IntegerxWidth Width of the window in Pixels
IntegeryWidth Height of the window in Pixels
Stringtitle Text displayed by the window
IntegerpositionSelection 1: the container hosting the element has BorderLayout policy
StringpositionInBorderLayout Position in the container hosting the element

Modelica definition

function infoButton "Write the Java code to generate an InfoButton" 
  input String fileName "Name of the Java file";
  input String name "Name of the element";
  input String parent "Name of the container hosting the elment";
  input String selected = "true" "Initial value";
  input String label "Text displayed with the element";
  input String alignment "Alignment of the text";
  input String image "Path of the image";
  input Integer bgcolor[4] "Background color";
  input String tooltip "Text of the tooltip";
  input Integer lettercolor[4] "Color of the text";
  input String typeFont "Type of font";
  input String styleFont "Style of font";
  input Integer sizeFont "Size of font";
  input String path "Path of the HTML pages";
  input Integer xPos "X coordinate of the window upper left corner in pixels";
  input Integer yPos "Y coordinate of the window upper left corner in pixels";
  input Integer xWidth "Width of the window in Pixels";
  input Integer yWidth "Height of the window in Pixels";
  input String title "Text displayed by the window";
   input Integer positionSelection 
    "1: the container hosting the element has BorderLayout policy";
  input String positionInBorderLayout 
    "Position in the container hosting the element";
   external "C";
  
end infoButton;

VirtualLabBuilder.src.Functions.button1Action

Write the Java code to generate a Button1Action

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringname Name of the element
Stringparent Name of the component hosting the element
Stringselected"true"Initial value
Stringlabel Text dispayed with the element
Stringalignment Text alignment
Stringimage Path of the image dispayed with the element
Integerbgcolor[4] Background color
Stringtooltip Text of the tooltip
Integerlettercolor[4] Letter color
StringtypeFont Type of font
StringstyleFont Style of font
IntegersizeFont Size of font
Integerposition Number identifying the interactive element
IntegerpositionSelection 1: the container hosting the element has BorderLayout policy
StringpositionInBorderLayout Position in the container hosting the element

Modelica definition

function button1Action 
  "Write the Java code to generate a Button1Action" 
  input String fileName "Name of the Java file";
  input String name "Name of the element";
  input String parent "Name of the component hosting the element";
  input String selected = "true" "Initial value";
  input String label "Text dispayed with the element";
  input String alignment "Text alignment";
  input String image "Path of the image dispayed with the element";
  input Integer bgcolor[4] "Background color";
  input String tooltip "Text of the tooltip";
  input Integer lettercolor[4] "Letter color";
  input String typeFont "Type of font";
  input String styleFont "Style of font";
  input Integer sizeFont "Size of font";
  input Integer position "Number identifying the interactive element";
  input Integer positionSelection 
    "1: the container hosting the element has BorderLayout policy";
  input String positionInBorderLayout 
    "Position in the container hosting the element";
   external "C";
  
end button1Action;

VirtualLabBuilder.src.Functions.button2Actions

Write the Java code to generate a Button2Actions

Inputs

TypeNameDefaultDescription
StringfileName Name of the Java file
Stringname Name of the element
Stringparent Name of the container hosting the element
Stringselected"true"Initial value
Stringlabel Name of the text dispayed with the element
Stringalignment Alignment of the text
Stringimage Paht of the image displayed with the element
Integerbgcolor[4] Background color
Stringtooltip Text of the tooltip
Integerlettercolor[4] Letter color
StringtypeFont Type of font
StringstyleFont Style of font
IntegersizeFont Size of font
Integerposition Number identifying the interactive element
IntegerpositionSelection 1: the container hosting the element has BorderLayout policy
StringpositionInBorderLayout Position in the container hosting the element

Modelica definition

function button2Actions 
  "Write the Java code to generate a Button2Actions" 
  input String fileName "Name of the Java file";
  input String name "Name of the element";
  input String parent "Name of the container hosting the element";
  input String selected = "true" "Initial value";
  input String label "Name of the text dispayed with the element";
  input String alignment "Alignment of the text";
  input String image "Paht of the image displayed with the element";
  input Integer bgcolor[4] "Background color";
  input String tooltip "Text of the tooltip";
  input Integer lettercolor[4] "Letter color";
  input String typeFont "Type of font";
  input String styleFont "Style of font";
  input Integer sizeFont "Size of font";
  input Integer position "Number identifying the interactive element";
  input Integer positionSelection 
    "1: the container hosting the element has BorderLayout policy";
  input String positionInBorderLayout 
    "Position in the container hosting the element";
   external "C";
  
end button2Actions;

VirtualLabBuilder.src.Functions.processingFile

Reads the number written in the first line of a file. Then, writes the number read incremented by one

Inputs

TypeNameDefaultDescription
Stringfile Path of the file

Outputs

TypeNameDescription
IntegernumNumber read in the file incremented by one

Modelica definition

function processingFile 
  "Reads the number written in the first line of a file. Then, writes the number read incremented by one" 
  
  input String file "Path of the file";
  output Integer num "Number read in the file incremented by one";
  
  external "C";
end processingFile;

HTML-documentation generated by Dymola Tue Jul 24 18:58:14 2007.