|
|||||||||
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
com.michaelbaranov.microba.common.MicrobaComponent
com.michaelbaranov.microba.marker.MarkerBar
public class MarkerBar
A bar with multiple draggable position marks.
Features:
BoundedTableModel
ListSelectionModel
MarkerMutationModel
MarkerBarUI
This implementation queries marker positions from a single table column of
the data model. The index defaults to 0, but you can specify it with
.
A marker is considered to be unmovable, if corresponding table cell of the
data model is reported to be uneditable.
setPositionColumn(int)
This implementation determines the only currently selected marker with
of the selection model, so current selection model's selection mode has no
effect.
ListSelectionModel.getLeadSelectionIndex()
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.BaselineResizeBehavior |
Field Summary | |
---|---|
static java.lang.String |
PROPERTY_COLOR_COLUMN
The name of a "colorColumn" property. |
static java.lang.String |
PROPERTY_DATA_MODEL
The name of a "dataModel" property. |
static java.lang.String |
PROPERTY_FLIP
The name of a "fliped" property. |
static java.lang.String |
PROPERTY_MUTATION_MODEL
The name of a "mutationModel" property. |
static java.lang.String |
PROPERTY_ORIENTATION
The name of a "orientation" property. |
static java.lang.String |
PROPERTY_POSITION_COLUMN
The name of a "positionColumn" property. |
static java.lang.String |
PROPERTY_SELECTION_MODEL
The name of a "selectionModel" property. |
Fields inherited from class com.michaelbaranov.microba.common.MicrobaComponent |
---|
PROPERTY_NAME_COLOR_OVERRIDE_MAP |
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, 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 | |
---|---|
MarkerBar()
Constructs a MarkerBar with all models set to a single
DefaultMarkerModel. |
|
MarkerBar(BoundedTableModel dataModel)
Constructs a MarkerBar with given data model, a
DefaultListSelectionModel |
|
MarkerBar(BoundedTableModel dataModel,
javax.swing.ListSelectionModel selectionModel)
Constructs a MarkerBar with given data model and selection
model. |
|
MarkerBar(int orientation)
Constructs a MarkerBar with given orientation. |
Method Summary | |
---|---|
int |
getColorColumn()
Returns an index of currently used table column to query marker color. |
BoundedTableModel |
getDataModel()
Returns current data model. |
int |
getMarkerSideGap()
Returns a distance in pixeld between the edge of the component (left & right edge for horizontal orientation, top & bottom edge for vertical) and a marker beak point in outermost position. |
MarkerMutationModel |
getMutationModel()
Returns current mutation model. |
int |
getOrientation()
Returns current component orientation. |
int |
getPositionColumn()
Returns an index of currently used table column to query marker position. |
javax.swing.ListSelectionModel |
getSelectionModel()
Returns current selection model. |
java.lang.String |
getUIClassID()
Look&Feel UI delegate key (classID). |
boolean |
isFliped()
Returns current flip flag value. |
void |
setColorColumn(int colorColumn)
Sets the index of the data model table column used to query marker color. |
void |
setDataModel(BoundedTableModel model)
Replaces current data model with specified one. |
void |
setFliped(boolean flip)
Set flip flag value. |
void |
setMutationModel(MarkerMutationModel mutationModel)
Replaces current mutation model with given one. |
void |
setOrientation(int orientation)
Re-orientates the component. |
void |
setPositionColumn(int positionColumn)
Sets the index of the data model table column used to query marker position. |
void |
setSelectionModel(javax.swing.ListSelectionModel selectionModel)
Replaces current selection model with given one. |
Methods inherited from class com.michaelbaranov.microba.common.MicrobaComponent |
---|
getColorOverrideMap, getUI, setColorOverrideMap, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, 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 |
Methods inherited from class java.awt.Container |
---|
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 |
Methods inherited from class java.awt.Component |
---|
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, 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, 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 |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROPERTY_DATA_MODEL
public static final java.lang.String PROPERTY_SELECTION_MODEL
public static final java.lang.String PROPERTY_MUTATION_MODEL
public static final java.lang.String PROPERTY_ORIENTATION
public static final java.lang.String PROPERTY_POSITION_COLUMN
public static final java.lang.String PROPERTY_COLOR_COLUMN
public static final java.lang.String PROPERTY_FLIP
Constructor Detail |
---|
public MarkerBar()
MarkerBar
with all models set to a single
DefaultMarkerModel.
DefaultMarkerModel
public MarkerBar(int orientation)
MarkerBar
with given orientation. All models
set to a single DefaultMarkerModel
.
orientation
- initial orientation. Possible values:
SwingConstants.HORIZONTAL
or
SwingConstants.VERTICAL
DefaultMarkerModel
public MarkerBar(BoundedTableModel dataModel)
MarkerBar
with given data model, a
DefaultListSelectionModel as selection model and no mutation model.
- Parameters:
dataModel
- initial data model. May be null- See Also:
BoundedTableModel
public MarkerBar(BoundedTableModel dataModel, javax.swing.ListSelectionModel selectionModel)
MarkerBar
with given data model and selection
model. No mutation model.
dataModel
- initial data model. May be null;selectionModel
- initial selection model.- See Also:
BoundedTableModel
Method Detail |
---|
public java.lang.String getUIClassID()
"MarkerBarUI".
- Overrides:
getUIClassID
in class javax.swing.JComponent
public BoundedTableModel getDataModel()
setDataModel(BoundedTableModel)
,
BoundedTableModel
public void setDataModel(BoundedTableModel model)
model
- new data model.getDataModel()
,
getPositionColumn()
,
BoundedTableModel
public int getOrientation()
setOrientation(int)
public void setOrientation(int orientation)
orientation
- new orientation value. Possible values:
SwingConstants.HORIZONTAL
or
SwingConstants.VERTICAL
getOrientation()
public MarkerMutationModel getMutationModel()
setMutationModel(MarkerMutationModel)
,
MarkerMutationModel
public void setMutationModel(MarkerMutationModel mutationModel)
mutationModel
- new mutation model. May be null.- See Also:
getMutationModel()
,
MarkerMutationModel
public javax.swing.ListSelectionModel getSelectionModel()
setSelectionModel(ListSelectionModel)
public void setSelectionModel(javax.swing.ListSelectionModel selectionModel)
ListSelectionModel.getLeadSelectionIndex()
to
determine selected marker.
selectionModel
- new selection model. May be null.- See Also:
getSelectionModel()
public int getPositionColumn()
setPositionColumn(int)
public void setPositionColumn(int positionColumn)
positionColumn
- new position column index.getPositionColumn()
public int getColorColumn()
setColorColumn(int)
public void setColorColumn(int colorColumn)
colorColumn
- new color column index.getColorColumn()
public int getMarkerSideGap()
MarkerBarUI
public boolean isFliped()
The flip flag defines where marker bicks are pointed:
true
: down for horizontal orientation, left for vertical.
false
: up for horizontal orientation, right for vertical.
public void setFliped(boolean flip)
The flip flag defines where marker bicks are pointed:
true
: down for horizontal orientation, left for vertical.
false
: up for horizontal orientation, right for vertical.
flip
- new flip flag value.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |