T
- the class of objects that are to be visualizedpublic class ProMTraceList<T>
extends javax.swing.JPanel
JPanel
that displays a list of arbitrary objects that are
visualized as "wedges" using ProMTraceView
. It uses a JList
under the hood, which can be accessed directly using getList()
.
To use this component you need to create a ProMTraceList.TraceBuilder
that takes
any of your objects and returns a ProMTraceView.Trace
of ProMTraceView.Event
s. This
conversion happens on-the-fly and only for the objects that are currently
shown to the user. Therefore, the performance overhead should be small.
There are default implementations ProMTraceView.DefaultTrace
and
ProMTraceView.DefaultEvent
available for convenience. If your class already
implements ProMTraceView.Trace
, then use the provided ProMTraceList.NoOpTraceBuilder
.
It is possible to sort and filter the list by using an appropriate
ListModel
. Such as SortableListModelImpl
or
FilteredListModelImpl
.
It is also possible to listen for click, selection and mouse movement events
on an element of the list by using
addTraceClickListener(ClickListener)
.
addTraceSelectionListener(ListSelectionListener)
, as well as
addTraceMoveListener(MoveListener)
.
Modifier and Type | Class and Description |
---|---|
static interface |
ProMTraceList.ClickListener<T> |
static class |
ProMTraceList.DefaultWedgeBuilder
ProMTraceList.WedgeBuilder that simply returns the original color of an
ProMTraceView.Event . |
static class |
ProMTraceList.DelegateWedgeBuilder
ProMTraceList.WedgeBuilder that delegates all methods to another
ProMTraceList.WedgeBuilder . |
static interface |
ProMTraceList.MoveListener<T> |
static class |
ProMTraceList.NoOpTraceBuilder<T extends ProMTraceView.Event>
TraceBuilder that just returns a class, which already implements
ProMTraceView.Trace . |
static interface |
ProMTraceList.TraceBuilder<T>
Builds
ProMTraceView.Trace objects for object of class T. |
static interface |
ProMTraceList.WedgeBuilder
Can be used to override the default coloring of an
ProMTraceView.Event based on
some other information. |
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_FIXED_WIDTH_TRACE_COUNT |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
ProMTraceList(java.util.Collection<T> traces,
ProMTraceList.TraceBuilder<T> traceBuilder)
Creates a filterable and sortable
ProMTraceList from the supplied
Collection of objects |
ProMTraceList(java.util.Collection<T> traces,
ProMTraceList.TraceBuilder<T> traceBuilder,
java.util.Comparator<T> order)
Creates a filterable and sortable
ProMTraceList from the supplied
Collection of objects |
ProMTraceList(java.util.Collection<T> traces,
ProMTraceList.TraceBuilder<T> traceBuilder,
java.util.Comparator<T> order,
java.awt.Font labelFont) |
ProMTraceList(java.util.Collection<T> traces,
ProMTraceList.TraceBuilder<T> traceBuilder,
java.util.Comparator<T> order,
java.awt.Font labelFont,
boolean hasLabels)
Creates a filterable and sortable
ProMTraceList from the supplied
Collection of objects |
ProMTraceList(java.util.Collection<T> traces,
ProMTraceList.TraceBuilder<T> traceBuilder,
java.awt.Font labelFont)
Creates a filterable and sortable
ProMTraceList from the supplied
Collection of objects |
ProMTraceList(java.util.Collection<T> traces,
ProMTraceList.TraceBuilder<T> traceBuilder,
java.awt.Font labelFont,
boolean hasLabels)
Creates a filterable and sortable
ProMTraceList from the supplied
Collection of objects |
ProMTraceList(javax.swing.ListModel<T> traceModel,
ProMTraceList.TraceBuilder<T> traceBuilder)
Creates a
ProMTraceList from the supplied ListModel , if
you want your list to be sortable and filterable your ListModel
needs to implement FilteredListModel and
SortableListModel . |
ProMTraceList(javax.swing.ListModel<T> traceModel,
ProMTraceList.TraceBuilder<T> traceBuilder,
java.awt.Font labelFont) |
ProMTraceList(javax.swing.ListModel<T> listModel,
ProMTraceList.TraceBuilder<T> traceBuilder,
java.awt.Font labelFont,
boolean hasLabels)
Creates a
ProMTraceList from the supplied ListModel , if
you want your list to be sortable and filterable your ListModel
needs to implement FilteredListModel and
SortableListModel . |
ProMTraceList(ProMTraceList.TraceBuilder<T> traceBuilder)
Creates an empty
ProMTraceList |
Modifier and Type | Method and Description |
---|---|
void |
add(T element)
Adds the element to this view.
|
void |
addAll(java.lang.Iterable<T> elements)
Adds the elements to this view.
|
void |
addTraceClickListener(ProMTraceList.ClickListener<T> l) |
void |
addTraceMoveListener(ProMTraceList.MoveListener<T> l) |
void |
addTraceSelectionListener(javax.swing.event.ListSelectionListener l) |
void |
afterUpdate() |
void |
beforeUpdate() |
void |
clear()
Clears the underlying data structure
getListModel() . |
void |
filter(FilteredListModelImpl.ListModelFilter<T> filter) |
float |
getAttenuationFactor() |
int |
getCollapsedLabelLength() |
javax.swing.JButton |
getDeselectAllButton() |
int |
getFixedWedgeLimit() |
javax.swing.JList<T> |
getList() |
javax.swing.ListModel<T> |
getListModel() |
int |
getMaxInfoWidth() |
int |
getMaxWedgeWidth() |
javax.swing.JScrollPane |
getScrollPane() |
javax.swing.JButton |
getSelectAllButton() |
javax.swing.JPanel |
getToolbar() |
ProMTraceList.TraceBuilder<T> |
getTraceBuilder() |
ProMTraceList.WedgeBuilder |
getWedgeBuilder() |
int |
getWedgeGap() |
java.awt.Stroke |
getWedgeStroke() |
boolean |
hasLabels() |
void |
hideToolbar() |
void |
removeTraceClickListener(ProMTraceList.ClickListener<T> l) |
void |
removeTraceMoveListener(ProMTraceList.MoveListener<T> l) |
void |
removeTraceSelectionListener(javax.swing.event.ListSelectionListener l) |
static <T> void |
saveAsEMF(ProMTraceList<T> traceList,
java.io.File file)
Saves the list content as EMF
|
static <T> void |
saveAsEPS(ProMTraceList<T> traceList,
java.io.File file)
Saves the list content as PS
|
static <T> void |
saveAsPDF(ProMTraceList<T> traceList,
java.lang.String pdfTitle,
java.io.File file)
Saves the list content as PDF
|
static <T> void |
saveAsSVG(ProMTraceList<T> traceList,
java.io.File file) |
static <T> void |
saveUsing(org.processmining.framework.util.ui.widgets.traceview.ProMTraceList.GraphicsExporterFactory graphicsExporter,
ProMTraceList<T> traceList)
Saves the list content as PDF
|
void |
setAttenuationFactor(float attenuationFactor)
Set the factor by which the color of the unselected traces is modified.
|
void |
setCollapsedLabelLength(int collapsedLabelLength)
Set the length of the label shown in a collapsed event, in an unselected
trace.
|
void |
setFixedInfoWidth(int fixedWidth)
Set the fixed width (in pixel) of the trace info area.
|
void |
setFixedWedgeLimit(int fixedWedgeLimit)
Changes the built-in limit of events per trace that is used to determine
when to switch to fixed size wedge width for performance reasons.
|
void |
setFixedWedgeWidth(int fixedWidth)
Set the fixed width (in pixel) of a single "event wedge".
|
void |
setMaxInfoWidth(int maxWidth)
Set the maximum width (in pixel) of the trace info area.
|
void |
setMaxWedgeWidth(int maxWidth)
Set the maximum width (in pixel) of a single "event wedge".
|
void |
setToolbar(javax.swing.JPanel toolbar) |
void |
setTraceBuilder(ProMTraceList.TraceBuilder<T> traceBuilder) |
void |
setWedgeBuilder(ProMTraceList.WedgeBuilder wedgeBuilder)
Use a
ProMTraceList.WedgeBuilder to dynamically override the color of an
ProMTraceView.Event . |
void |
setWedgeGap(int wedgeGap) |
void |
setWedgeStroke(java.awt.Stroke wedgeStroke) |
void |
showToolbar() |
void |
sort(java.util.Comparator<T> sortOrder) |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, unregisterKeyboardAction, update
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, validateTree
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, 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, transferFocusUpCycle
public static final int DEFAULT_FIXED_WIDTH_TRACE_COUNT
public ProMTraceList(ProMTraceList.TraceBuilder<T> traceBuilder)
ProMTraceList
traceBuilder
- public ProMTraceList(java.util.Collection<T> traces, ProMTraceList.TraceBuilder<T> traceBuilder)
ProMTraceList
from the supplied
Collection
of objectstraces
- traceBuilder
- public ProMTraceList(java.util.Collection<T> traces, ProMTraceList.TraceBuilder<T> traceBuilder, java.awt.Font labelFont)
ProMTraceList
from the supplied
Collection
of objectstraces
- traceBuilder
- labelFont
- public ProMTraceList(java.util.Collection<T> traces, ProMTraceList.TraceBuilder<T> traceBuilder, java.awt.Font labelFont, boolean hasLabels)
ProMTraceList
from the supplied
Collection
of objectstraces
- traceBuilder
- labelFont
- hasLabels
- public ProMTraceList(java.util.Collection<T> traces, ProMTraceList.TraceBuilder<T> traceBuilder, java.util.Comparator<T> order)
ProMTraceList
from the supplied
Collection
of objectstraces
- traceBuilder
- order
- public ProMTraceList(java.util.Collection<T> traces, ProMTraceList.TraceBuilder<T> traceBuilder, java.util.Comparator<T> order, java.awt.Font labelFont)
public ProMTraceList(java.util.Collection<T> traces, ProMTraceList.TraceBuilder<T> traceBuilder, java.util.Comparator<T> order, java.awt.Font labelFont, boolean hasLabels)
ProMTraceList
from the supplied
Collection
of objectstraces
- traceBuilder
- order
- labelFont
- hasLabels
- public ProMTraceList(javax.swing.ListModel<T> traceModel, ProMTraceList.TraceBuilder<T> traceBuilder)
ProMTraceList
from the supplied ListModel
, if
you want your list to be sortable and filterable your ListModel
needs to implement FilteredListModel
and
SortableListModel
.traceModel
- traceBuilder
- public ProMTraceList(javax.swing.ListModel<T> traceModel, ProMTraceList.TraceBuilder<T> traceBuilder, java.awt.Font labelFont)
public ProMTraceList(javax.swing.ListModel<T> listModel, ProMTraceList.TraceBuilder<T> traceBuilder, java.awt.Font labelFont, boolean hasLabels)
ProMTraceList
from the supplied ListModel
, if
you want your list to be sortable and filterable your ListModel
needs to implement FilteredListModel
and
SortableListModel
.traces
- traceBuilder
- labelFont
- to be usedwhether
- there should be space for labelspublic void addTraceSelectionListener(javax.swing.event.ListSelectionListener l)
public void removeTraceSelectionListener(javax.swing.event.ListSelectionListener l)
public void addTraceClickListener(ProMTraceList.ClickListener<T> l)
public void removeTraceClickListener(ProMTraceList.ClickListener<T> l)
public void addTraceMoveListener(ProMTraceList.MoveListener<T> l)
public void removeTraceMoveListener(ProMTraceList.MoveListener<T> l)
public javax.swing.JList<T> getList()
JList
public javax.swing.JScrollPane getScrollPane()
JScrollPane
public javax.swing.ListModel<T> getListModel()
ListModel
public void add(T element)
ListModel
needs
to implement MutableListModel
otherwise an
UnsupportedOperationException
will be thrown.element
- java.lang.UnsupportedOperationException
- in case the ListModel is not mutablepublic void addAll(java.lang.Iterable<T> elements)
ListModel
needs
to implement MutableListModel
otherwise an
UnsupportedOperationException
will be thrown.elements
- java.lang.UnsupportedOperationException
- in case the ListModel is not mutablepublic void clear()
getListModel()
.java.lang.UnsupportedOperationException
- in case the ListModel is not mutablepublic void sort(java.util.Comparator<T> sortOrder)
public void filter(FilteredListModelImpl.ListModelFilter<T> filter)
public void setAttenuationFactor(float attenuationFactor)
attenuationFactor
- non-negative factorpublic float getAttenuationFactor()
public ProMTraceList.WedgeBuilder getWedgeBuilder()
public void setWedgeBuilder(ProMTraceList.WedgeBuilder wedgeBuilder)
ProMTraceList.WedgeBuilder
to dynamically override the color of an
ProMTraceView.Event
. Use ProMTraceList.DefaultWedgeBuilder
, if you only want to
override a certain color.wedgeBuilder
- that overrides the default color of an eventpublic int getMaxWedgeWidth()
public void setMaxWedgeWidth(int maxWidth)
maxWidth
- public int getMaxInfoWidth()
public void setMaxInfoWidth(int maxWidth)
maxWidth
- public void setFixedWedgeWidth(int fixedWidth)
fixedWidth
- public void setFixedInfoWidth(int fixedWidth)
fixedWidth
- public int getFixedWedgeLimit()
public void setFixedWedgeLimit(int fixedWedgeLimit)
fixedWedgeLimit
- public int getCollapsedLabelLength()
public void setCollapsedLabelLength(int collapsedLabelLength)
collapsedLabelLength
- public java.awt.Stroke getWedgeStroke()
public void setWedgeStroke(java.awt.Stroke wedgeStroke)
wedgeStroke
- the default Stroke
that the wedges border is painted
withpublic int getWedgeGap()
public void setWedgeGap(int wedgeGap)
wedgeGap
- sets the default gap between two event wedgespublic ProMTraceList.TraceBuilder<T> getTraceBuilder()
public void setTraceBuilder(ProMTraceList.TraceBuilder<T> traceBuilder)
traceBuilder
- that is used to create traces out of the input objectspublic void beforeUpdate()
public void afterUpdate()
public void showToolbar()
public void hideToolbar()
public javax.swing.JPanel getToolbar()
public void setToolbar(javax.swing.JPanel toolbar)
public static <T> void saveAsPDF(ProMTraceList<T> traceList, java.lang.String pdfTitle, java.io.File file) throws java.io.IOException
pdfTitle
- file
- graphicsExporter
- java.io.IOException
public static <T> void saveAsEMF(ProMTraceList<T> traceList, java.io.File file) throws java.io.IOException
file
- graphicsExporter
- java.io.IOException
public static <T> void saveAsEPS(ProMTraceList<T> traceList, java.io.File file) throws java.io.IOException
file
- graphicsExporter
- java.io.IOException
public static <T> void saveAsSVG(ProMTraceList<T> traceList, java.io.File file) throws java.io.IOException
java.io.IOException
public static <T> void saveUsing(org.processmining.framework.util.ui.widgets.traceview.ProMTraceList.GraphicsExporterFactory graphicsExporter, ProMTraceList<T> traceList) throws java.io.IOException
pdfTitle
- file
- java.io.IOException
public javax.swing.JButton getSelectAllButton()
public javax.swing.JButton getDeselectAllButton()
public boolean hasLabels()