|
Side of Software Marker Bar Library 1.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.plaf.ComponentUI
sos.marker.MarkerBarUI
sos.marker.BasicMarkerBarUI
public class BasicMarkerBarUI
A basic implementation of the marker bar look and feel.
JMarkerBar| Field Summary | |
|---|---|
static java.lang.String |
BACKGROUND_KEY
The look-and-feel key for the default background color of a marker bar. |
static java.lang.String |
FOREGROUND_KEY
The look-and-feel key for the default foreground color of a marker bar. |
static java.lang.String |
HEIGHT_KEY
The look-and-feel key for the default height of a horizontal marker bar. |
protected JMarkerBar |
markerBar
The marker bar for which this BasicMarkerBarUI is responsible. |
static java.lang.String |
RENDERER_KEY
The look-and-feel key for the default marker renderer for a marker bar. |
protected javax.swing.CellRendererPane |
rendererPane
The renderer pane that is used to render the marker components. |
static java.lang.String |
WIDTH_KEY
The look-and-feel key for the default width of a vertical marker bar. |
| Constructor Summary | |
|---|---|
BasicMarkerBarUI()
Creates an instance of BasicMarkerBarUI. |
|
| Method Summary | |
|---|---|
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent c)
Returns an instance of the UI delegate for the specified component. |
java.awt.Rectangle |
getMarkerBounds(JMarkerBar markerBar,
int markerIndex)
Returns the rectangle for which the marker at the specified index is rendered, in the marker bar's coordinate system. |
java.awt.Dimension |
getPreferredSize(javax.swing.JComponent c)
Returns the specified component's preferred size appropriate for the look and feel. |
protected void |
installDefaults()
Initializes the marker bar with its defaults. |
void |
installUI(javax.swing.JComponent c)
Initializes the specified component (which must be a marker bar) by invoking installListeners() and installDefaults() and
by adding the renderer pane. |
int[] |
locationToIndices(JMarkerBar markerBar,
java.awt.Point point)
Returns the indexes of the markers that are rendered at the specified point. |
void |
paint(java.awt.Graphics g,
javax.swing.JComponent c)
Paints the specified component appropriate for the look and feel. |
protected void |
uninstallDefaults()
Removes the defaults set in installDefaults. |
protected void |
uninstallListeners()
Unregisters the listeners registered in installListeners. |
void |
uninstallUI(javax.swing.JComponent c)
Uninitializes the marker bar by invoking uninstallListeners()
and uninstallDefaults(). |
| Methods inherited from class javax.swing.plaf.ComponentUI |
|---|
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, update |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String BACKGROUND_KEY
UIManager.put( BasicMarkerBarUI.BACKGROUND_KEY, Color.blue );
public static final java.lang.String FOREGROUND_KEY
UIManager.put( BasicMarkerBarUI.FOREGROUND_KEY, Color.blue );
public static final java.lang.String WIDTH_KEY
UIManager.put( BasicMarkerBarUI.WIDTH_KEY, 20 );
public static final java.lang.String HEIGHT_KEY
UIManager.put( BasicMarkerBarUI.HEIGHT_KEY, 20 );
public static final java.lang.String RENDERER_KEY
UIManager.put( BasicMarkerBarUI.RENDERER_KEY, new CustomerMarkerRenderer() );
protected JMarkerBar markerBar
protected javax.swing.CellRendererPane rendererPane
| Constructor Detail |
|---|
public BasicMarkerBarUI()
| Method Detail |
|---|
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
getPreferredSize in class javax.swing.plaf.ComponentUIc - the component whose preferred size is being queried;
this argument is ignored.protected void installDefaults()
uninstallDefaults(),
installUI(javax.swing.JComponent)public void installUI(javax.swing.JComponent c)
installListeners() and installDefaults() and
by adding the renderer pane.
installUI in class javax.swing.plaf.ComponentUIc - the component for which this UI delegate is being installed
java.lang.ClassCastException - if c is not a JMarkerBaruninstallUI(javax.swing.JComponent),
installListeners(),
installDefaults()
public void paint(java.awt.Graphics g,
javax.swing.JComponent c)
paint in class javax.swing.plaf.ComponentUIg - the Graphics context in which to paintc - the component being painted; this argument is ignored.protected void uninstallDefaults()
installDefaults(),
uninstallUI(javax.swing.JComponent)protected void uninstallListeners()
installListeners(),
uninstallUI(javax.swing.JComponent)public void uninstallUI(javax.swing.JComponent c)
uninstallListeners()
and uninstallDefaults().
uninstallUI in class javax.swing.plaf.ComponentUIinstallUI(javax.swing.JComponent),
uninstallListeners(),
uninstallDefaults()
public java.awt.Rectangle getMarkerBounds(JMarkerBar markerBar,
int markerIndex)
MarkerBarUI
getMarkerBounds in class MarkerBarUImarkerBar - marker bar containing the marker in questionmarkerIndex - index of the marker in the marker bar's model for which the
region is requested
null if the
index is out of range
public int[] locationToIndices(JMarkerBar markerBar,
java.awt.Point point)
MarkerBarUI
locationToIndices in class MarkerBarUImarkerBar - marker bar containing the markerspoint - point in question
|
Side of Software Marker Bar Library 1.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||