public class GUIChart extends GUIelement
CHECKBOX, READOUT, SELECTBOX, SLIDER
Modifier and Type | Method and Description |
---|---|
void |
addLine(PlotLine pl)
Add a new line, setting the color of it in such a way, that it's easily
distinguishable from the other colors of lines already in the chart.
|
void |
addProperthies() |
void |
autoScaleX()
Autoscales the chart along the X axis.
|
void |
autoScaleY()
Autoscales the chart along the Y axis.
|
void |
drawLegend(javafx.scene.canvas.GraphicsContext gc,
double x,
double y)
Draws the letters of the individual lines, with additional info (such as,
whether those lines are selected, visible, whether they exist and more).
|
int |
getHeight() |
PlotLine |
getLine(java.lang.String letter,
boolean createIfNonexistant)
If the line with this letter exists, return it; otherwise create it and
return it, if the 2nd argument is set to true or ignore otherwise.
|
FloatProperty |
getLineProperty(java.lang.String lineLetter,
int propertyId)
Return the line property object, given the letter of the line, property
of which we are accessing, and the ID, determining which property we are
accessing.
|
PlotLine |
getPlotLineByChar(char c)
Get a PlotLine object, provided a char.
|
java.lang.String |
getSampleEventString()
Get the name for the CLUC callback user function, which can be placed in
the user code to automatically get called, whenever some of the lines of
this chart are sampled.
|
int |
getWidth() |
void |
increaseValue(boolean forward,
boolean fast) |
GUIelement |
makeCopy() |
void |
paint(javafx.scene.canvas.GraphicsContext gc,
double x,
double y)
Paint this
GUIelement on some place on the
GraphicsContext provided, on position, determined by the x and y
arguments. |
void |
paintCursor(javafx.scene.canvas.GraphicsContext gc,
javafx.scene.paint.Color c,
double x,
double y)
Paint the line cursor, on position defined by x,y, with color c, to the
GraphicsContext gc.
|
void |
paintHistograms(javafx.scene.canvas.GraphicsContext gc,
double minX,
double minY,
double maxX,
double maxY)
Paint histograms for all of the lines, currently visible.
|
void |
paintLines(javafx.scene.canvas.GraphicsContext gc,
double minX,
double minY,
double maxX,
double maxY)
Paint all visible lines, clamping the parts outside the ranges determined
by minX, minY, maxX, maxY
|
void |
paintSingleHistogram(javafx.scene.canvas.GraphicsContext gc,
PlotLine pl,
javafx.scene.paint.Color fillCol,
javafx.scene.paint.Color strokeCol,
double minX,
double minY,
double maxX,
double maxY)
Paint a single histogram, stored in the PlotLine pl, as a series of
rectangles, given a fill color and a stroke color and also minimum and
maximum positions, beyond which the histogram should never be drawn.
|
void |
paintSingleLine(PlotLine pl,
javafx.scene.canvas.GraphicsContext gc,
javafx.scene.paint.Color c,
double lineWidth,
double minX,
double minY,
double maxX,
double maxY)
Paint a single line pl on the provided GraphicsContext gc, with a Color
c, line width lineWidth, clamped by minX, minY, maxX, maxY
|
void |
paintTicks(javafx.scene.canvas.GraphicsContext gc,
double minX,
double minY,
double maxX,
double maxY)
Paint the chart axes with the ticks.
|
void |
recompileEvents()
Compile the bytecode for all CLUC events, that can be fired by this
GUIelement , including the getters and setters of the individual
Property objects. |
void |
sampleAllRelevant()
Adds a data point to all selected lines on their respective cursor
positions (if there are any selected and the vFlag is on), or to the
currently focused line otherwise.
|
void |
scaleAlongOrigin(double amountX,
double amountY,
double originX,
double originY)
Scales the chart by amount, where amount is expressed as percents
normalised to 1 (1= keep current scale).
|
void |
setCurrentLineChar(char c)
Sets the current line character to the one provided.
|
void |
setGUIPanel(GUIPanel gup)
This method sets the containing GUI Panel of the GUI element.
|
void |
setGUITab(GUITab gut)
Set the respective
GUITab this GUIelement is on to the
one provided. |
boolean |
setLineProperty(java.lang.String lineLetter,
int propertyId,
float value)
Set the float property, determined by its propertyId, of line, determined
by its line letter, to the provided value
|
void |
setValue(float value)
Set the Value
Property to a new number, firing the Java callbacks
as well as CLUC callbacks afterwards. |
java.lang.String |
shortDesc() |
void |
startRecording()
Starts an automatic recording of all relevant lines.
|
void |
stopRecording()
Stops recording of all lines.
|
addElementTypeMapping, addFloatProperty, addGlobalElementMapping, addIntegerProperty, addMapping, addProperty, addStringProperty, addTags, copyPropertiesTo, getColor1, getColor2, getColor3, getColor4, getContextDependantName, getElementTypeMappingManager, getGlobalElementMappingManager, getGUIelementName, getGUIPanel, getId2NameMap, getId2PropertyMap, getLastPositionDrawnTo, getMax, getMenu, getMin, getModuleGUIID, getName, getName2IdMap, getProperty2idMap, getPropertyById, getPropertyByName, getRegister, getTags, getThisInstanceMappingManager, getUniqueName, getValue, hasTag, isDeleted, isEnabled, isFocused, isSelected, isVisible, isWithinBounds, notifyAboutKeyPress, recalculateUniqueName, removeAllTags, removeTags, requestRepaint, setDeleted, setEnabled, setFloatProperty, setFocused, setId2NameMap, setId2PropertyMap, setIntegerProperty, setMenu, setModuleGUIID, setName, setName2IdMap, setProperty2idMap, setRegister, setSelected, setStringProperty, setVisible, update
public GUIChart()
public GUIChart(GUITab gut)
public final void addProperthies()
public void addLine(PlotLine pl)
pl
- public void stopRecording()
public void startRecording()
sampleAllRelevant
public void setCurrentLineChar(char c)
c
- the character to set the current line char to.public void setValue(float value)
GUIelement
Property
to a new number, firing the Java callbacks
as well as CLUC callbacks afterwards. Said callbacks might modify this
number, so subsequent call to getValue
may not yield a number
identical to the one just set.setValue
in class GUIelement
value
- the number to set the Value Property to.public java.lang.String shortDesc()
shortDesc
in class GUIelement
public void setGUIPanel(GUIPanel gup)
GUIelement
setGUIPanel
in class GUIelement
public void setGUITab(GUITab gut)
GUIelement
GUITab
this GUIelement
is on to the
one provided.setGUITab
in class GUIelement
public void autoScaleX()
public void autoScaleY()
public void sampleAllRelevant()
public void increaseValue(boolean forward, boolean fast)
public void scaleAlongOrigin(double amountX, double amountY, double originX, double originY)
amountX
- amount of scale along the X axis in percent normalised to
1. 0.5=scale to half; 0.9: scale to 90%; 1=keep current sizeamountY
- amount of scale along the Y axis in percent normalised to
1. 0.5=scale to half; 0.9: scale to 90%; 1=keep current sizeoriginX
- X coordinate of the origin point to perform the transform
around; expressed in pixels, in coordinates relative to the top left
corner of the GUIChart element.originY
- Y coordinate of the origin point to perform the transform
around; expressed in pixels, in coordinates relative to the top left
corner of the GUIChart element.public void paint(javafx.scene.canvas.GraphicsContext gc, double x, double y)
GUIelement
GUIelement
on some place on the
GraphicsContext
provided, on position, determined by the x and y
arguments.paint
in class GUIelement
gc
- the GraphicsContext
to draw tox
- the x position to draw toy
- the y position to draw topublic GUIelement makeCopy()
makeCopy
in class GUIelement
GUIelement
. All Property
objects are also duplicated. The callbacks are not preserved.GUIelement.copyPropertiesTo(InstrumentationPlatformGUI.Elements.GUIelement)
public PlotLine getPlotLineByChar(char c)
c
- the letter of the line to be returnedpublic int getHeight()
getHeight
in class GUIelement
public int getWidth()
getWidth
in class GUIelement
public void paintSingleLine(PlotLine pl, javafx.scene.canvas.GraphicsContext gc, javafx.scene.paint.Color c, double lineWidth, double minX, double minY, double maxX, double maxY)
pl
- the PlotLine object to drawgc
- the GraphicsContext to draw toc
- the color to draw the line withlineWidth
- the width of the line to drawminX
- - the minimum X to draw to. The drawn line will get clamped
by this coordinate.minY
- - the minimum X to draw to. The drawn line will get clampedmaxX
- - the minimum X to draw to. The drawn line will get clampedmaxY
- - the minimum X to draw to. The drawn line will get clampedpublic void paintLines(javafx.scene.canvas.GraphicsContext gc, double minX, double minY, double maxX, double maxY)
gc
- - the GraphicsContext to draw tominX
- - the minimum X to draw to. The drawn line will get clamped
by this coordinate.minY
- - the minimum X to draw to. The drawn line will get clampedmaxX
- - the minimum X to draw to. The drawn line will get clampedmaxY
- - the minimum X to draw to. The drawn line will get clampedpublic void paintCursor(javafx.scene.canvas.GraphicsContext gc, javafx.scene.paint.Color c, double x, double y)
gc
- c
- x
- y
- public void paintSingleHistogram(javafx.scene.canvas.GraphicsContext gc, PlotLine pl, javafx.scene.paint.Color fillCol, javafx.scene.paint.Color strokeCol, double minX, double minY, double maxX, double maxY)
gc
- - the GraphicsContext to draw topl
- - the PlotLine to extract the Histogram fromfillCol
- - the color, with which the bins in the histogram should
be filledstrokeCol
- - the color, with which the outline of the histogram
should be strokedminX
- - the minimum X position to draw to. The part of the
rectangle left to this X will get cropped (won't display).minY
- - the minimum Y position to draw to. The part of the
rectangle down to this Y will get cropped (won't display).maxX
- - the maximum X position to draw to. The part of the
rectangle right to this X will get cropped (won't display).maxY
- - the maximum Y position to draw to. The part of the
rectangle up to this Y will get cropped (won't display).public void paintHistograms(javafx.scene.canvas.GraphicsContext gc, double minX, double minY, double maxX, double maxY)
gc
- minX
- - the minimum X position to draw to. The part of the
rectangle left to this X will get cropped (won't display).minY
- - the minimum Y position to draw to. The part of the
rectangle down to this Y will get cropped (won't display).maxX
- - the maximum X position to draw to. The part of the
rectangle right to this X will get cropped (won't display).maxY
- - the maximum Y position to draw to. The part of the
rectangle up to this Y will get cropped (won't display).paintSingleHistogram
public void drawLegend(javafx.scene.canvas.GraphicsContext gc, double x, double y)
gc
- - the GraphicsContext to draw tox
- - the x position, at which the upper left point of the legend
text should be locatedy
- - the y position, at which the upper left point of the legend
text should be locatedpublic void paintTicks(javafx.scene.canvas.GraphicsContext gc, double minX, double minY, double maxX, double maxY)
gc
- the GraphicsContext to which the axes should be drawnminX
- the minimum X, determining the bounds, beyond which nothing
should be drawnminY
- the minimum Y, determining the bounds, beyond which nothing
should be drawnmaxX
- the maximum X, determining the bounds, beyond which nothing
should be drawnmaxY
- the maximum Y, determining the bounds, beyond which nothing
should be drawnpublic void recompileEvents()
GUIelement
GUIelement
, including the getters and setters of the individual
Property
objects.recompileEvents
in class GUIelement
public PlotLine getLine(java.lang.String letter, boolean createIfNonexistant)
letter
- createIfNonexistant
- whether the line should be created, if no
line with this letter existspublic boolean setLineProperty(java.lang.String lineLetter, int propertyId, float value)
lineLetter
- - the letter used to determine property of which line
should be accessedpropertyId
- - the ID, determining which property of the line should
be accessed.value
- - the value the property should be set toProperty.getId()
public FloatProperty getLineProperty(java.lang.String lineLetter, int propertyId)
lineLetter
- - the letter used to determine property of which line
should be accessedpropertyId
- - the ID, determining which property of the line should
be accessed.public java.lang.String getSampleEventString()