Class QueueNetAnimation
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
common.animation.QueueNetAnimation
- All Implemented Interfaces:
Animation, ImageObserver, MenuContainer, Serializable, Accessible
- Direct Known Subclasses:
OptimizedQNAnimation, SampleQNAnimation
-
Nested Class Summary
Nested classes/interfaces inherited from class JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Vector<EdgeAnimation> elements of this queue net animationprotected Vector<JobAnimation> elements of this queue net animationprotected Vector<StationAnimation> elements of this queue net animationFields inherited from class JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of QueueNetAnimation.QueueNetAnimation(IconsToolkit toolkit) Creates a new instance of QueueNetAnimation with a customized toolkit for renderization of the queuenet background. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEdge(EdgeAnimation edge, StationAnimation source, StationAnimation target) Adds an edge between two stations of this queuenet.voidaddJob(JobAnimation jobAnimation, JobContainer startingPoint) Adds a job to be routed through this queue net.voidaddStation(StationAnimation station) Adds a station to this queue net.returns background image for this animation.getSinglePath(StationAnimation start, StationAnimation end) Returns a possible path for this queue net, which must start from start station and end in end station.getSuccessors(JobContainer precedant) Returns a list of successor nodes for the specified one.voidinit()Initialization method for implementing class.voidpaint(Graphics g, ImageObserver io) Paints image currently handled in a rectangle defined withinAnimation.setBounds(Rectangle)methodvoidrefresh()Called when an animation needs to be refreshed.voidsetBGImage(Image img) sets background image for this animation.voidUpdates the image shown during animation, e.g.Methods inherited from class JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class JComponent
addAncestorListener, 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, hide, 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, unregisterKeyboardActionMethods inherited from class Container
add, 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, validateTreeMethods inherited from class Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, 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, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
stations
elements of this queue net animation -
edges
elements of this queue net animation -
jobs
elements of this queue net animation
-
-
Constructor Details
-
QueueNetAnimation
public QueueNetAnimation()Creates a new instance of QueueNetAnimation. -
QueueNetAnimation
Creates a new instance of QueueNetAnimation with a customized toolkit for renderization of the queuenet background.
-
-
Method Details
-
refresh
-
update
Updates the image shown during animation, e.g. calls paint() method in every queue net element's implementing class contained in this queue net.- Overrides:
updatein classJComponent- Parameters:
g- : Graphics object used to repaint image.
-
init
-
paint
Description copied from interface:AnimationPaints image currently handled in a rectangle defined withinAnimation.setBounds(Rectangle)method -
getBGImage
Description copied from interface:Animationreturns background image for this animation.- Specified by:
getBGImagein interfaceAnimation- Returns:
- :Background image for this animation
-
setBGImage
Description copied from interface:Animationsets background image for this animation.- Specified by:
setBGImagein interfaceAnimation- Parameters:
img- : background image for this animation
-
addStation
Adds a station to this queue net.- Parameters:
station- : station to be added to this queuenet
-
addEdge
Adds an edge between two stations of this queuenet.- Parameters:
edge- : new edge to be added.source- : source station for this edge.target- : target station for this edge.
-
addJob
Adds a job to be routed through this queue net.- Parameters:
jobAnimation- : job to be added.startingPoint- : queue net element from which this job should start its path.
-
getSuccessors
Returns a list of successor nodes for the specified one.- Parameters:
precedant- : current node- Returns:
- list of nodes which are successors of the current one.
-
getSinglePath
Returns a possible path for this queue net, which must start from start station and end in end station. If there's no path that links this two stations, then null value is returned. This is useful in case a job is wanted to run on certain edges and stations and not on all. This method is not optimized to search for the shortest path, so it will find the first valid path available.- Parameters:
start- : starting point for this path.end- : ending point for this path.- Returns:
- a possible path between start and end stations, or null if does not exist.
-