- All Implemented Interfaces:
Runnable
,RTS_Drawing.Animable
Additional System class TextElement.
Link class TextElement(t,x,y); Value t; Text t; Long Real x,y; begin Integer COLOR,STROKE; Text T; Long Real X,Y; ref(Font) FONT; ! Java Class Font is not visible in Simula ; Procedure setColor(color); Integer color; COLOR := color; Procedure setStroke(width); Real width; CURRENT_STROKE_WIDTH := width; Procedure setFontStylePlain; FONT :- FONT.deriveFont(Font.PLAIN); Procedure setFontStyleBold; FONT :- FONT.deriveFont(Font.BOLD); Procedure setFontStyleItalic; FONT :- FONT.deriveFont(Font.ITALIC); Procedure setFontStyleBoldItalic; FONT :- FONT.deriveFont(Font.BOLD|Font.ITALIC); Procedure setFontSize(size); Real size; FONT :- FONT.deriveFont(size); Real Procedure getFontSize; getFontSize := FONT.getSize2D; Procedure setText(t); Value t; Text t; T :- t; Procedure moveTo(x,y,speed); Long Real x,y,speed; begin X := x; Y := y; ... end; Procedure instantMoveTo(x,y); Long Real x,y; begin X := x; Y := y; end; T :- t; X := x; Y := y; COLOR := CURRENT_DRAW_COLOR; STROKE := CURRENT_STROKE_WIDTH; FONT :- CURRENT_FONT; into(RENDERING_SET); end;Link to GitHub: Source File.
- Author:
- Øystein Myhre Andersen
-
Nested Class Summary
Nested classes/interfaces inherited from class simula.runtime.RTS_RTObject
RTS_RTObject.ForElt, RTS_RTObject.ForList, RTS_RTObject.ForListIterator, RTS_RTObject.OperationalState, RTS_RTObject.RTS_BOOLEAN_ARRAY, RTS_RTObject.RTS_BOUNDS, RTS_RTObject.RTS_CHARACTER_ARRAY, RTS_RTObject.RTS_INTEGER_ARRAY, RTS_RTObject.RTS_LABEL, RTS_RTObject.RTS_LONG_REAL_ARRAY, RTS_RTObject.RTS_NAME<T>, RTS_RTObject.RTS_REAL_ARRAY, RTS_RTObject.RTS_REALTYPE_ARRAY, RTS_RTObject.RTS_REF_ARRAY<T>, RTS_RTObject.RTS_TEXT_ARRAY, RTS_RTObject.SingleElt<T>, RTS_RTObject.SingleTValElt, RTS_RTObject.StepUntil, RTS_RTObject.UncaughtExceptionHandler, RTS_RTObject.WhileElt<T>, RTS_RTObject.WhileTValElt
-
Field Summary
Modifier and TypeFieldDescription(package private) final RTS_Drawing
The current animation.(package private) Color
The current color.(package private) Font
The current Font.(package private) String
The current string text.(package private) Stroke
The current stroke.(package private) double
The X coordinate(package private) double
The Y coordinateFields inherited from class simula.runtime.RTS_Linkage
PRED, SUC
Fields inherited from class simula.runtime.RTS_ENVIRONMENT
_STARTTIME, CURRENTDECIMALMARK, CURRENTLOWTEN, EXCEPTION_HANDLER, maxint, maxlongreal, maxreal, minint, minlongreal, minreal, simulaReleaseID
Fields inherited from class simula.runtime.RTS_RTObject
_CORUT, _CTX, _CUR, _DL, _INPUT_LINELENGTH, _JTX, _OUTPUT_LINELENGTH, _SL, _STATE, _SYSIN, _SYSOUT, NOTEXT
-
Constructor Summary
ConstructorDescriptionRTS_TextElement
(RTS_RTObject SL, String str, double x, double y) Create a new _TextElement.RTS_TextElement
(RTS_RTObject SL, RTS_TXT txt, double x, double y) Create a new _TextElement. -
Method Summary
Modifier and TypeMethodDescription_STM()
Method representing the Statements in this Block
This method is virtual and must be redefined in blocks.float
Get font size.void
instantMoveTo
(double x, double y) Instant move.void
moveTo
(double x2, double y2, double speed) Rolling motion to a new position.void
paint
(Graphics2D g) Paint this Animablevoid
setColor
(int rgb) Set color.void
setFontSize
(float size) Set font size.void
Set font style bold.void
Set font style bold and italic.void
Set font style talic.void
Set font style plain.void
setStroke
(float size) Set stroke size.void
Set new text.Methods inherited from class simula.runtime.RTS_Linkage
pred, prev, suc
Methods inherited from class simula.runtime.RTS_BASICIO
toString
Methods inherited from class simula.runtime.RTS_ENVIRONMENT
_char, _IPOW, _IS, abs, abs, abs, addepsilon, addepsilon, arccos, arcsin, arctan, arctan2, Char, clocktime, cos, cosh, cotan, cputime, datetime, decimalmark, DEFEXCEPTION, digit, discrete, draw, edfix, edit, edit, edit, edit, edit, edtime, entier, Erlang, error, exp, getIntInfo, getTextInfo, giveIntInfo, giveTextInfo, hash, histd, histo, isochar, isorank, letter, linear, ln, loadChar, log10, lowcase, lowerbound, lowten, max, max, max, max, max, min, min, min, min, min, mod, negexp, normal, Poisson, printStaticChain, printThreadList, randint, rank, rem, rts_utility, sign, simulaid, sin, sinh, sqrt, storeChar, subepsilon, subepsilon, tan, tanh, uniform, upcase, upperbound, waitSomeTime
Methods inherited from class simula.runtime.RTS_RTObject
_ASGSTR, _ASGTXT, _GOTO, _JUMPTABLE, _JUMPTABLE, _LABEL, _PRE_LABEL, _PRE_TABLE, _SIM_LABEL, _TXTREL_EQ, _TXTREL_GE, _TXTREL_GT, _TXTREL_LE, _TXTREL_LT, _TXTREL_NE, _VALUE, arrayValue, BBLK, blanks, BPRG, call, call, CONC, copy, detach, detach, detach, doubleValue, EBLK, edObjectAttributes, edObjectIdent, floatValue, getErrorMessage, intValue, isDetachUsed, isQPSystemBlock, objectTraceIdentifier, objectTraceIdentifier, objectValue, procValue, resume, resume, resume, swapCoroutines, sysin, sysout, terminate_program, TRACE_GOTO, TRF_EQ, TRF_NE
-
Field Details
-
Constructor Details
-
RTS_TextElement
Create a new _TextElement.- Parameters:
SL
- staticLinktxt
- the initial textx
- the X coordinatey
- the Y coordinate
-
RTS_TextElement
Create a new _TextElement.- Parameters:
SL
- staticLinkstr
- the initial textx
- the X coordinatey
- the Y coordinate
-
-
Method Details
-
_STM
Description copied from class:RTS_RTObject
Method representing the Statements in this Block
This method is virtual and must be redefined in blocks. -
setFontStylePlain
public void setFontStylePlain()Set font style plain. -
setFontStyleBold
public void setFontStyleBold()Set font style bold. -
setFontStyleItalic
public void setFontStyleItalic()Set font style talic. -
setFontStyleBoldItalic
public void setFontStyleBoldItalic()Set font style bold and italic. -
setStroke
public void setStroke(float size) Set stroke size.- Parameters:
size
- stroke size
-
getFontSize
public float getFontSize()Get font size.- Returns:
- the font size
-
setFontSize
public void setFontSize(float size) Set font size.- Parameters:
size
- font size
-
setColor
public void setColor(int rgb) Set color.- Parameters:
rgb
- color
-
setText
Set new text.- Parameters:
t
- new text
-
instantMoveTo
public void instantMoveTo(double x, double y) Instant move.- Parameters:
x
- the X coordinatey
- the Y coordinate
-
moveTo
public void moveTo(double x2, double y2, double speed) Rolling motion to a new position.- Parameters:
x2
- the X coordinatey2
- the Y coordinatespeed
- pixels per milli-second
-
paint
Description copied from interface:RTS_Drawing.Animable
Paint this Animable- Specified by:
paint
in interfaceRTS_Drawing.Animable
- Parameters:
g
- the graphic context
-