|
||||||||||
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.peace_tools.views.overlap.ClusterList
class ClusterList
A combo-box like custom component to display list of clusters from a tool bar.
This component provides a custom GUI component that looks similar to a combo-box but uses a JList in its popup to display a set of choices that permit multiple-selections. This permits the user to select multiple clusters and apply colors (and possibly other transformations) to the selected set. This component consists of the following set of independent sub-components:
NoteThis class is meant to be instantiated and used only by the OverlapView class. Consequently it has been made package private.
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
private java.awt.Color |
borderColor
The color of the border to be used for this component to provide a simple line border that makes it look like a static control. |
private javax.swing.JButton |
changeColor
A tool bar style button that permits the user to change the colors associated with the selected clusters. |
private javax.swing.JList |
clusterList
The list that displays the list of clusters currently present in the memory model. |
private javax.swing.JScrollPane |
clusterListJSP
The scroll pane that contains the clusterList so that
the list can scroll when the there are a large number of clusters. |
private ClusterColorMapper |
colorMapper
Helper to look-up color for a given cluster ID. |
private javax.swing.JButton |
dropDownButton
The drop down button (with a small triangle) to display cluster pop up list. |
private static java.lang.String |
LOW_COLOR_MSG
A fixed message that is displayed to the user to indicate that some of the clusters have duplicate colors. |
private OverlapModel |
overlapModel
The OverlapModel that provides the necessary information for rendering the core information required by this panel. |
private javax.swing.JComponent |
owner
The final top-level component that logically owns this cluster list. |
private javax.swing.JPopupMenu |
popupList
The pop up that contains the cluster list to be displayed to the user. |
private javax.swing.JButton |
randomColors
A tool bar style button that permits the user to assign random colors to each cluster. |
private javax.swing.JLabel |
selectionStats
A simple non-editable text field to display cluster selection statistics. |
private static long |
serialVersionUID
Generated serialization UID (merely to keep the compiler happy) |
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 | |
---|---|
ClusterList(OverlapModel overlapModel,
ClusterColorMapper colorMapper,
javax.swing.JComponent owner)
The default constructor. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
|
private void |
createClusterListAndPopup()
Creates the cluster list used to display clusters. |
void |
paintComponent(java.awt.Graphics g)
|
protected void |
setColors(java.util.List<java.awt.Color> colorList)
Sets color for selected or all clusters to given color. |
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, 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, 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, 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, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private javax.swing.JLabel selectionStats
private javax.swing.JButton dropDownButton
private final javax.swing.JButton changeColor
private final javax.swing.JButton randomColors
private javax.swing.JPopupMenu popupList
private javax.swing.JList clusterList
createClusterListAndPopup()
method.
private javax.swing.JScrollPane clusterListJSP
clusterList
so that
the list can scroll when the there are a large number of clusters.
private final OverlapModel overlapModel
private final javax.swing.JComponent owner
private final ClusterColorMapper colorMapper
private final java.awt.Color borderColor
private static final java.lang.String LOW_COLOR_MSG
actionPerformed(ActionEvent)
method.
private static final long serialVersionUID
Constructor Detail |
---|
public ClusterList(OverlapModel overlapModel, ClusterColorMapper colorMapper, javax.swing.JComponent owner)
overlapModel
- The overlap model from where the data regarding
the set of clusters is retrieved.colorMapper
- The helper object to be used to determine the
color for rendering fragments belonging to various clusters.owner
- The owner to be repainted whenever colors for clusters
are changed.Method Detail |
---|
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed
in interface java.awt.event.ActionListener
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
protected void setColors(java.util.List<java.awt.Color> colorList)
colorList
- The list of colors to be used for assigning
colors to various clusters. If this list is null, then a default
color of grey is assigned to each cluster.private void createClusterListAndPopup()
popupList
that is used to display the cluster
list whenever the user clicks on the dropDownButton
. This
method is invoked only once from the constructor. It was primarily
introduced to streamline the constructor.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |