public class BackgroundElementGrafic extends javax.swing.JComponent implements Grafic
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Border_Default, BOUNDARY_WIDTH, COLOR_BACKGROUND, COLOR_BORDER, COLOR_FOREGROUND, COLOR_INFOPANE_MARKED, COLOR_SWITCH_BACKGROUND, COLOR_SWITCH_STOCK_BOUND, COLOR_ZOOM_MARKER, FONT_BIG, FONT_DEFAULT, FONT_SMALL, LAYER_BACKGROUND, LAYER_BackGroundElement, LAYER_BackGroundLine, LAYER_Bin, LAYER_ENTITY, LAYER_LIST, LAYER_MARKER, LAYER_PROCESS, LAYER_PROCESS_LINE_LIST, LAYER_RESOURCE, LAYER_ROUTE_DYNAMIC, LAYER_ROUTE_STATIC, LAYER_STATION, LAYER_STATISTIC, LAYER_STOCK, LAYER_WAITING_QUEUE, layer0, STATION_DEFAULT_DIMENSION
Constructor and Description |
---|
BackgroundElementGrafic(BackgroundElement backgroundElement,
java.lang.String viewId,
java.awt.Point middle,
java.awt.Color textColor)
Constructor for fixed size rectangle with text and transparent background
When in backgroundElement a name is set, then a border with the name is displayed.
|
BackgroundElementGrafic(BackgroundElement backgroundElement,
java.lang.String viewId,
java.awt.Point middle,
java.awt.Dimension size,
java.awt.Color background)
Constructor for fixed size rectangle without text
When in backgroundElement a name is set, then a border with the name is displayed.
|
BackgroundElementGrafic(BackgroundElement backgroundElement,
java.lang.String viewId,
java.awt.Point topLeft,
java.awt.Point bottomRight,
java.awt.Color background)
Constructor for dynamic size rectangle without text
When in backgroundElement a name is set, then a border with the name is displayed.
|
BackgroundElementGrafic(BackgroundElement backgroundElement,
java.lang.String viewId,
java.awt.Point topLeft,
java.awt.Point bottomRight,
java.awt.Point middle,
java.awt.Dimension size,
java.awt.Color textColor,
java.awt.Color background)
Constructor with all features
There a 2 possible cases:
(topLeft and bottomRight are both null) xor (middle and size are null)
When in backgroundElement a name is set, then a border with the name is displayed.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Rectangle |
getBoundsExtern()
get external size
|
static java.awt.Rectangle |
getBoundsExternGlobal(Model model,
java.lang.String viewId)
Construct the smallest rectangle,
which include the positions of all entities in view
|
java.lang.String |
getViewId() |
static java.lang.String[] |
getViews(Model model)
get all views (viewId's) with BackgroundElements
|
void |
transform()
transforms from external to internal coordinate system
|
void |
update(java.awt.Color foreground,
java.awt.Color background)
Update of GraficGrafic
called by BackgroundElement.setData and
BackgroundElementGragic.updateInit()
|
static void |
updateInit(Model model,
java.lang.String viewId,
javax.swing.JComponent panel)
called by ViewGrafic.updateInit
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, 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, 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, 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, transferFocusUpCycle
public BackgroundElementGrafic(BackgroundElement backgroundElement, java.lang.String viewId, java.awt.Point middle, java.awt.Dimension size, java.awt.Color background)
backgroundElement
- viewId
- Id of viewmiddle
- middlePointsize
- fixed size of elementbackground
- background color, when null then transparentpublic BackgroundElementGrafic(BackgroundElement backgroundElement, java.lang.String viewId, java.awt.Point topLeft, java.awt.Point bottomRight, java.awt.Color background)
backgroundElement
- topLeft
- topLeft cornerbottomRight
- bottomRight cornerbackground
- background color, when null then transparentpublic BackgroundElementGrafic(BackgroundElement backgroundElement, java.lang.String viewId, java.awt.Point middle, java.awt.Color textColor)
backgroundElement
- viewId
- Id of viewmiddle
- middlePointtextColor
- color of textpublic BackgroundElementGrafic(BackgroundElement backgroundElement, java.lang.String viewId, java.awt.Point topLeft, java.awt.Point bottomRight, java.awt.Point middle, java.awt.Dimension size, java.awt.Color textColor, java.awt.Color background)
backgroundElement
- viewId
- Id of viewtopLeft
- topLeft cornerbottomRight
- bottomRight cornermiddle
- middlePointsize
- fixed size of elementtextColor
- color of textbackground
- background color, when null then transparentpublic static java.lang.String[] getViews(Model model)
public static java.awt.Rectangle getBoundsExternGlobal(Model model, java.lang.String viewId)
viewId
- id of viewpublic static void updateInit(Model model, java.lang.String viewId, javax.swing.JComponent panel)
panel
- public java.lang.String getViewId()
public void transform()
public java.awt.Rectangle getBoundsExtern()
public void update(java.awt.Color foreground, java.awt.Color background)