public interface IViewComponent
This is the interface of all viewable components. So, it is responsible for all buttons, labels etc. of a special device group. A device group is in this case for example the radio frequency (RF) or temperature. All these components are shown or better viewed on the display of the application.
There exists different method for setting the displayed string, for enabling or disabling the current component or to set its invisibility. The current component will extends the swing component and implement this interface:
public final class RFButton extends JButton implements IViewComponent { ... }
All these methods can mostly be called on the class JComponent which is derived by all swing components. But this interface gives a disjunction between different methods and what the concrete projects requires. Moreover there also exists methods for getting or setting the label of a JLabel or JButton. But one thing made this impossible to be used in a clean way: you can ask java about the instance of the JComponent if it is a label or button, but this makes the code complex. And if there a list of components the code is getting much more complex and one will be confused about the code.
With this interface there exists one class which allows you to ask for different things, for example which label is set or if the component is opaque or enabled. So, that you only should store an instance of this interface, for example in a list. The method by itself will return the values from the super class or null, when it does not exist. You have just separated it into two different fragments which where before only one.
So, this interface behaves like a an Adapter design pattern between two different classes.
Modifier and Type | Method and Description |
---|---|
void |
debug()
This will debug the viewable component, by, for example, displaying the
outer area as a line border or something like that.
|
EGraphicComponent |
fetchGraphicComponent()
Returns the current component as an enumeration value.
|
ESeverity |
fetchSeverity()
Fetches the severity of the component.
|
java.lang.String |
fetchText(IEData view_)
This will fetch the text of the component.
|
boolean |
hasOpaque()
Tells the caller if this component is drawn with a background or not.
|
boolean |
isEnable()
Asks if the current component is enabled and so for click-able on the
screen.
|
boolean |
isValueAdjusting(IEData view_)
Queries if the value is adjusting.
|
boolean |
isVisual()
Queries if this component is opaque or not.
|
void |
putBackground(java.awt.Color background_)
Sets the current background color.
|
void |
putBorder(javax.swing.border.Border border_)
Puts the Swing border to the component.
|
void |
putEnable(boolean enable_)
Sets the enable property.
|
void |
putForeground(java.awt.Color foreground_)
Sets the current foreground color.
|
void |
putListener(java.util.EventListener listener_)
Adds a new listener to these object.
|
void |
putNumber(java.lang.Number number_,
IEData view_)
Sets the current number.
|
void |
putOpaque(boolean opaque_)
Sets the opaque of this component.
|
void |
putSelected(boolean isSelected_)
Puts the selected boolean value to the viewable component.
|
void |
putSeverity(ESeverity severity_)
Sets the severity of this component.
|
void |
putText(java.lang.String label_,
IEData view_)
Will set the displayed label text of the component.
|
void |
putTooltip(java.lang.String tooltip_)
Puts the tool tip text to the viewable component.
|
void |
putVisual(boolean visual_)
Sets the visibility of this component.
|
void putListener(java.util.EventListener listener_)
listener_
- The listener interface.EGraphicComponent fetchGraphicComponent()
java.lang.String fetchText(IEData view_)
view_
- This is the current view element in which you wanted to append
the above label text. This can be in some inherited class also be
null.boolean isValueAdjusting(IEData view_)
Queries if the value is adjusting. If this is true it will return the value true otherwise false.
The word adjusting means that you take a component and drag it around on screen with holding down the key or mouse button pressed. If this occurs a true is returned.
view_
- Is the data component for which this method will query for.void putText(java.lang.String label_, IEData view_)
label_
- This is the text as a string value which represents the
current displayed text.view_
- This is the current view element in which you wanted to append
the above label text. This can be in some inherited class also be
null.boolean isEnable()
boolean isVisual()
void putSeverity(ESeverity severity_)
severity_
- The severity value.ESeverity fetchSeverity()
Fetches the severity of the component. This value has no direct influence on the GUI element but tells the caller if the severity value is set and sets corresponding the background and foreground color, for example.
boolean hasOpaque()
void putEnable(boolean enable_)
enable_
- Enables or disables this component.void putVisual(boolean visual_)
visual_
- Sets the visibility of the component to be true or not.void putOpaque(boolean opaque_)
opaque_
- The opaque value.void putForeground(java.awt.Color foreground_)
foreground_
- Is the current foreground color.void putBackground(java.awt.Color background_)
background_
- Is the current background color.void putNumber(java.lang.Number number_, IEData view_)
number_
- The number to be set.view_
- Is the viewable data component.void putTooltip(java.lang.String tooltip_)
tooltip_
- The tool tip text.void putSelected(boolean isSelected_)
isSelected_
- Is a boolean value.void putBorder(javax.swing.border.Border border_)
border_
- Is a Swing border.void debug()
14-September-2016 18:23 Deutsches Elektronen-Synchrotron DESY in der Helmholtz-Gemeinschaft