|
|||||||||
| 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.AbstractButton
javax.swing.JButton
cytoscape.visual.ui.ValueDisplayer
public class ValueDisplayer
Given an Object, figures out the class of the object and creates a JButton suitable for displaying the value of that object. When the button is pressed, it should pop up a user interface to change the value. The class interested in the selection of the ValueDisplayer should add an ItemListener to the button. The ItemListener is triggered when the user's selection changes.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JButton |
|---|
JButton.AccessibleJButton |
| Nested classes/interfaces inherited from class javax.swing.AbstractButton |
|---|
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static byte |
ARROW
Display and get input for an arrowhead |
static byte |
COLOR
Display and get input for a color |
protected byte |
dispType
Holds the type of UI this ValueDisplayer will pop up. |
static byte |
DOUBLE
Display and get input for a double |
static byte |
FONT
Display and get input for a font |
static DecimalFormat |
formatter
Formatting for numeric types. |
static byte |
INT
Display and get input for an int |
static byte |
LINETYPE
Display and get input for a linetype |
static byte |
NODESHAPE
Display and get input for node shape |
static byte |
STRING
Display and get input for a string |
| 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 javax.swing.SwingConstants |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Method Summary | |
|---|---|
protected void |
fireItemSelected()
This method fires the itemListeners. |
static ValueDisplayer |
getBlankDisplayFor(JDialog parent,
String title,
byte type)
Get a blank or default display/input pair for a given type of input. |
static ValueDisplayer |
getBlankDisplayFor(JDialog parent,
String title,
Object sampleObj)
Get a blank or default display/input pair for the given sample object, which itself is ignored. |
static ValueDisplayer |
getDisplayFor(JDialog parent,
String title,
Object o)
Get a display/input pair initialized to a given type of input. |
static ValueDisplayer |
getDisplayForColor(JDialog parent,
String title,
Color c)
|
ActionListener |
getInputListener()
Returns the ActionListener that will pop up the input UI when triggered. |
Object |
getSelectedItem()
Provided for convenience. |
byte |
getType()
Returns the type of input this ValueDisplayer displays/gets input for |
Object |
getValue()
Returns an object representing the user input. |
void |
setEnabled(boolean b)
Set the ValueDisplayer active/inactive. |
void |
setObject(Object o)
Externally sets the object displayed. |
| Methods inherited from class javax.swing.JButton |
|---|
configurePropertiesFromAction, getAccessibleContext, getUIClassID, isDefaultButton, isDefaultCapable, paramString, removeNotify, setDefaultCapable, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static DecimalFormat formatter
public static final byte COLOR
public static final byte LINETYPE
public static final byte ARROW
public static final byte STRING
public static final byte DOUBLE
public static final byte NODESHAPE
public static final byte INT
public static final byte FONT
protected byte dispType
| Method Detail |
|---|
public Object getSelectedItem()
getValue()public Object getValue()
public ActionListener getInputListener()
public byte getType()
public void setEnabled(boolean b)
setEnabled in class AbstractButtonb - true to enable, false to disable
public static ValueDisplayer getDisplayForColor(JDialog parent,
String title,
Color c)
protected void fireItemSelected()
public void setObject(Object o)
throws ClassCastException
ClassCastException - if caller attempts to set an object
different from what was being represented.
public static ValueDisplayer getBlankDisplayFor(JDialog parent,
String title,
byte type)
parent - The parent dialog for the returned ValueDisplayertitle - Title to display for input dialogtype - Type of input, one of COLOR, LINETYPE,
NODESHAPE, ARROW, STRING,
DOUBLE, INT, FONT
ClassCastException - if you didn't pass in a known type
public static ValueDisplayer getBlankDisplayFor(JDialog parent,
String title,
Object sampleObj)
parent - The parent dialog for the returned ValueDisplayertitle - Title to display for input dialogo -
ClassCastException - if you didn't pass in a known type
public static ValueDisplayer getDisplayFor(JDialog parent,
String title,
Object o)
throws ClassCastException
GraphicsEnvrionment
parent - The parent dialog for the returned ValueDisplayero - Object to represent. Should be a Color,
LineType, node shape (byte), arrow,
string, or number
ClassCastException - if you didn't pass in a known type
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||