public class DashboardPanel
extends javax.swing.JPanel
DashboardFrame and
contains everything the user sees except for the window outline. This class
is the workhorse of the GUI. Inside here is where the logic is contained for
how to respond to new fields and various other things.javax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponentaccessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
DashboardPanel(DashboardFrame frame,
ITable table)
Instantiates the panel
|
| Modifier and Type | Method and Description |
|---|---|
void |
addElement(DisplayElement element,
java.awt.Point point)
Adds the given display element to the screen, putting it at the given
point.
|
void |
addField(java.lang.String key)
Adds the field of the given name to the screen.
|
void |
addMouseListener(java.awt.event.MouseListener l) |
void |
addMouseMotionListener(java.awt.event.MouseMotionListener l) |
void |
addSubsystem(LWSubsystem subsystem)
For resetting the LiveWindow.
|
void |
clear()
Clears the panel of all of its data, and then reload it.
|
DisplayElement |
findElementContaining(java.awt.Point point)
Returns the element that covers the given point.
|
java.lang.Iterable<DisplayElement> |
getElements()
Returns all the
DisplayElements that are in this
panel. |
java.lang.Iterable<java.lang.String> |
getHiddenFields()
Returns the names of all the fields marked as hidden (they are the ones
in the
ITable that have been explicitly declared to be ignored by
the user). |
java.util.ArrayList<LWSubsystem> |
getSubsystems()
Gets the subsystems stored in this panel.
|
ITable |
getTable() |
boolean |
isEditable()
Returns whether or not this panel is editable.
|
void |
removeElement(StaticWidget widget)
Removes the given element from the screen.
|
void |
removeField(java.lang.String field)
Removes the field with the given name from the screen.
|
void |
removeUnusedFields()
Removes all fields which do not have values in the
|
void |
revalidateBacking()
Revalidates the content behind the glass pane
|
void |
setEditable(boolean editable)
Sets whether or not this panel is editable.
|
void |
setField(java.lang.String key,
java.lang.Class<? extends Widget> preferred,
DataType type,
java.lang.Object value,
java.awt.Point point)
Sets the field to use the given values.
|
void |
setField(java.lang.String key,
java.lang.Class<? extends Widget> preferred,
java.lang.Object value,
java.awt.Point point)
Sets the field to use the given values.
|
void |
setField(java.lang.String key,
Widget element,
DataType type,
java.lang.Object value,
java.awt.Point point)
Sets the element to use for the given field, removing the current element
if one exists for that field.
|
void |
shiftToBack(DisplayElement element)
Shifts the given element behind all the other ones.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic DashboardPanel(DashboardFrame frame, ITable table)
public ITable getTable()
public void addMouseListener(java.awt.event.MouseListener l)
addMouseListener in class java.awt.Componentpublic void addMouseMotionListener(java.awt.event.MouseMotionListener l)
addMouseMotionListener in class java.awt.Componentpublic void revalidateBacking()
public void setEditable(boolean editable)
editable - whether or not the pane should be editablepublic boolean isEditable()
public java.lang.Iterable<java.lang.String> getHiddenFields()
ITable that have been explicitly declared to be ignored by
the user).public java.lang.Iterable<DisplayElement> getElements()
DisplayElements that are in this
panel.public void clear()
public void removeUnusedFields()
public void removeField(java.lang.String field)
field - the field to removepublic void removeElement(StaticWidget widget)
Widget instead of a StaticWidget, then consider using
removeField(...)widget - the widget to removepublic void shiftToBack(DisplayElement element)
element - the element to shiftpublic void addElement(DisplayElement element, java.awt.Point point)
null, then it will find a place to
put it. If the point is not null, then the given
DisplayElement should already have set its size.element - the element to addpoint - the location to put it (or null, if one needs to be found)public void setField(java.lang.String key,
Widget element,
DataType type,
java.lang.Object value,
java.awt.Point point)
load(...) method.key - the name of the fieldelement - the element to give to that fieldtype - the type of the datavalue - the value of the datapoint - the point to put itpublic void addField(java.lang.String key)
key - the key to addpublic void setField(java.lang.String key,
java.lang.Class<? extends Widget> preferred,
java.lang.Object value,
java.awt.Point point)
key - the key of the fieldpreferred - the preferred widget to usevalue - the value of the field (must not be null)point - the point the widget should be (can be null)public void setField(java.lang.String key,
java.lang.Class<? extends Widget> preferred,
DataType type,
java.lang.Object value,
java.awt.Point point)
key - the key of the fieldpreferred - the preferred widget to usetype - the type of the fieldvalue - the value of the field (can be null)point - the point the widget should be (can be null)public DisplayElement findElementContaining(java.awt.Point point)
point - the point on the screenpublic java.util.ArrayList<LWSubsystem> getSubsystems()
public void addSubsystem(LWSubsystem subsystem)
subsystem - The subsystem to add to this panel's list of subsystems.