|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.processmining.mining.dmcscanning.ui.LogItemPanel
public class LogItemPanel
LogItemPanel. The purpose of this class is to provide a view of a log, in form of a horizontal ribbon, with abstract items (that have a start and end time) laid out on it, equipped with handles to distinguish. This class expects SortedSets of LogItems, which are grouped automatically with a specific color and can be removed again bulk-wise. Make sure that the added LogItems fully support the methods to retrieve start and end in temporal fashion, as the implementation of this class depends on that.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected int |
border
|
protected java.util.Calendar |
cal
|
protected java.awt.Color |
colorBg
|
protected java.awt.Color |
colorFg
|
protected java.awt.Color |
colorLogBright
|
protected java.awt.Color |
colorLogDark
|
static java.lang.String[] |
HANDLE_ICONS
|
protected double |
handleRatio
|
static java.lang.String |
ITEM_HANDLE_BOX
|
static java.lang.String |
ITEM_HANDLE_CIRCLE
|
static java.lang.String |
ITEM_HANDLE_NONE
|
static java.lang.String |
ITEM_HANDLE_RHOMBUS
|
static java.lang.String |
ITEM_HANDLE_TRIANGLE
|
protected ColorRepository |
itemColors
|
protected java.lang.String |
itemHandle
|
protected java.util.HashMap |
itemSets
|
protected java.util.Date |
logBoundaryLeft
|
protected java.util.Date |
logBoundaryRight
|
protected int |
logLanePixStep
|
protected long |
logLaneStep
|
protected double |
milli2pixels
|
protected double |
viewportZoom
|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
LogItemPanel(java.util.Date leftBoundary,
java.util.Date rightBoundary)
constructor |
Method Summary | |
---|---|
java.awt.Color |
addItem(java.lang.String key,
LogItem item)
Adds a new LogItem to the set of displayed items within this viewport. |
java.awt.Color |
addItemSet(java.lang.String key,
java.util.SortedSet anItemSet)
Adds a SortedSet of LogItems to be displayed as a group of items within this viewport. |
protected void |
adjustLogBoundaries()
consolidates the global log viewing area. |
void |
clearItemSets()
initializes componente, i.e. |
protected java.util.Date |
coord2time(double anX)
convenience method. |
protected long |
coord2timeMillis(double anX)
convenience method. |
java.awt.Color |
getColor(java.lang.String key)
Retrieves the color mapped to an item set |
protected int |
getHandleHeight()
|
java.util.Date |
getLeftLogBoundary()
|
protected int |
getLogPaneHeight()
|
java.util.Date |
getRightLogBoundary()
|
double |
getViewportZoom()
|
protected static boolean |
intersects(java.util.Date d1Left,
java.util.Date d1Right,
java.util.Date d2Left,
java.util.Date d2Right)
Checks two time frames for intersection. |
void |
paintComponent(java.awt.Graphics grx)
paints this log item panel and all contained log items as specified. |
protected void |
paintHandle(int x,
int y,
java.awt.Graphics g)
convenience method for internal use. |
protected void |
paintItem(int xStart,
int xEnd,
int yLogTop,
int yLogHeight,
int yHandle,
java.awt.Graphics g)
convenience method for internal use. |
protected void |
paintLogLane(java.awt.Graphics g)
convenience method for internal use. |
boolean |
removeItemSet(java.lang.String key)
Removes the grouped set of LogItems referenced by the supplied key from the viewport |
void |
setBorder(int aBorder)
Sets the uniform border size for the viewport |
void |
setHandleRatio(double aRatio)
Sets the ratio between log display and handle view height |
void |
setItemHandle(java.lang.String anItemHandle)
Sets the item handle visualization type |
void |
setLeftLogBoundary(java.util.Date aBoundary)
adjusts the log boundaries to be displayed. |
void |
setLogBoundaries(java.util.Date leftBoundary,
java.util.Date rightBoundary)
adjusts the log boundaries to be displayed. |
void |
setRightLogBoundary(java.util.Date aBoundary)
adjusts the log boundaries to be displayed. |
void |
setSize(java.awt.Dimension d)
overwritten as proxy, to update mill2pixels ratio |
void |
setSize(int width,
int height)
overwritten as proxy, to update mill2pixels ratio |
void |
setViewportZoom(double aZoom)
adjusts the viewable are of the log (zoom) |
protected int |
time2coord(java.util.Date aTimestamp)
Convenience method. |
protected int |
time2coord(long aTimeMillis)
Convenience method. |
protected void |
updateMilli2pixelsRatio()
Updates the internally cached ratio between milliseconds (of events) and pixels on the screen. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, update |
Methods inherited from class java.awt.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, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.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, 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, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.lang.String ITEM_HANDLE_NONE
public static java.lang.String ITEM_HANDLE_CIRCLE
public static java.lang.String ITEM_HANDLE_TRIANGLE
public static java.lang.String ITEM_HANDLE_BOX
public static java.lang.String ITEM_HANDLE_RHOMBUS
public static java.lang.String[] HANDLE_ICONS
protected java.util.HashMap itemSets
protected java.util.Date logBoundaryLeft
protected java.util.Date logBoundaryRight
protected double milli2pixels
protected long logLaneStep
protected int logLanePixStep
protected double viewportZoom
protected java.lang.String itemHandle
protected java.awt.Color colorBg
protected java.awt.Color colorFg
protected java.awt.Color colorLogDark
protected java.awt.Color colorLogBright
protected ColorRepository itemColors
protected int border
protected double handleRatio
protected java.util.Calendar cal
Constructor Detail |
---|
public LogItemPanel(java.util.Date leftBoundary, java.util.Date rightBoundary)
leftBoundary
- Date representing the left boundary (start) of the log to be visualizedrightBoundary
- Date representing the right boundary (end) of the log to be visualizedMethod Detail |
---|
public java.awt.Color addItemSet(java.lang.String key, java.util.SortedSet anItemSet)
key
- reference to this item set, for e.g. later selective removalanItemSet
- expects a sorted set of 'LogItem' instances.
public java.awt.Color addItem(java.lang.String key, LogItem item)
key
- identifier used to group related items (by color etc.)item
- the item to be added
public boolean removeItemSet(java.lang.String key)
key
- reference string for the set to remove
public void clearItemSets()
public java.awt.Color getColor(java.lang.String key)
key
- the key referencing the item set
public void setLeftLogBoundary(java.util.Date aBoundary)
aBoundary
- the left log boundarypublic void setRightLogBoundary(java.util.Date aBoundary)
aBoundary
- the right log boundarypublic void setLogBoundaries(java.util.Date leftBoundary, java.util.Date rightBoundary)
leftBoundary
- the left log boundaryrightBoundary
- the right log boundarypublic java.util.Date getLeftLogBoundary()
public java.util.Date getRightLogBoundary()
protected void updateMilli2pixelsRatio()
public void setSize(int width, int height)
setSize
in class java.awt.Component
public void setSize(java.awt.Dimension d)
setSize
in class java.awt.Component
public void setViewportZoom(double aZoom)
aZoom
- fraction of the log to be viewable (within (0,1] !)public double getViewportZoom()
protected void adjustLogBoundaries()
public void setItemHandle(java.lang.String anItemHandle)
anItemHandle
- use one of the static ITEM_HANDLE_* strings provided, otherwise it will be a messpublic void setBorder(int aBorder)
aBorder
- public void setHandleRatio(double aRatio)
aRatio
- a value within [0.1, 0.9]protected int getHandleHeight()
protected int getLogPaneHeight()
protected int time2coord(java.util.Date aTimestamp)
aTimestamp
-
protected int time2coord(long aTimeMillis)
aTimeMillis
-
protected java.util.Date coord2time(double anX)
anX
-
protected long coord2timeMillis(double anX)
anX
-
protected static boolean intersects(java.util.Date d1Left, java.util.Date d1Right, java.util.Date d2Left, java.util.Date d2Right)
d1Left
- d1Right
- d2Left
- d2Right
-
protected void paintItem(int xStart, int xEnd, int yLogTop, int yLogHeight, int yHandle, java.awt.Graphics g)
xStart
- horizontal start coordinate of the eventxEnd
- horizontal end coordinate of the eventyLogTop
- vertical coordinate of the log pane level (top)yLogHeight
- vertical size (height) of log itemsyHandle
- vertical coordinate of the handle level (center)g
- the Graphics object used for paintingprotected void paintHandle(int x, int y, java.awt.Graphics g)
x
- horizontal anchor coordinate of the handley
- vertical anchor coordinate of the handleg
- the Graphics object used for paintingprotected void paintLogLane(java.awt.Graphics g)
gOrig
- dMin
- date on the left boundarydMax
- date on the right boundarypublic void paintComponent(java.awt.Graphics grx)
paintComponent
in class javax.swing.JComponent
g
- the graphics object used for painting
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |