|
|||||||||
| 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
com.samskivert.swing.CollapsiblePanel
com.threerings.editor.swing.BasePropertyEditor
public abstract class BasePropertyEditor
Abstract base class for PropertyEditor and EditorPanel.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| 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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected static Icon |
_collapseIcon
Collapse/expand icons. |
protected EditorContext |
_ctx
Provides access to common services. |
protected static Icon |
_expandIcon
Collapse/expand icons. |
protected JButton |
_highlight
The highlight button. |
protected boolean |
_highlighted
If the border should be highlighted. |
protected static Icon |
_highlightIcon
Collapse/expand icons. |
protected MessageManager |
_msgmgr
The message manager to use for translations. |
protected MessageBundle |
_msgs
The default message bundle. |
protected static int |
BASE_BACKGROUND
The base background value that we darken to indicate nesting. |
protected static int |
DEFAULT_BACKGROUND
The default background value. |
protected static Dimension |
PANEL_BUTTON_SIZE
The size of the panel buttons. |
protected static int |
SHADE_DECREMENT
The number of units to darken for each shade. |
| Fields inherited from class com.samskivert.swing.CollapsiblePanel |
|---|
_content, _downIcon, _trigger, _upIcon |
| 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 | |
|---|---|
BasePropertyEditor()
|
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent event)
|
void |
addChangeListener(ChangeListener listener)
Adds a listener for change events. |
protected void |
copyPropertyPath(String path)
Copies the path of the property under the mouse cursor to the clipboard. |
protected JButton |
createButton(Icon icon)
Creates a button with the supplied text. |
protected Color |
darkenColor(int color,
float shades)
|
protected void |
fireStateChanged()
Fires a state changed event. |
protected Color |
getBackgroundColor(Property[] lineage)
Returns a background color darkened and colored for this level. |
protected int |
getColor(String name)
Returns a label for the supplied name, translating it if a translation exists. |
protected int |
getColor(String name,
MessageBundle msgs,
int defaultColor)
Returns a label for the supplied name, translating it if a translation exists. |
protected int |
getColor(String name,
String bundle,
int defaultColor)
Returns a label for the supplied name, translating it if a translation exists. |
protected Color |
getDarkerBackground(float shades)
Returns a background color darkened by the specified number of shades. |
String |
getLabel(Class<?> type)
Returns a label for the supplied type. |
protected String |
getLabel(String name)
Returns a label for the supplied name, translating it if a translation exists. |
protected String |
getLabel(String name,
MessageBundle msgs)
Returns a label for the supplied name, translating it if a translation exists. |
protected String |
getLabel(String name,
String bundle)
Returns a label for the supplied name, translating it if a translation exists. |
String[] |
getLabels(String[] names)
Returns an array of labels for the supplied names, translating those that have translations. |
String[] |
getLabels(String[] names,
MessageBundle msgs)
Returns an array of labels for the supplied names, translating those that have translations. |
String[] |
getLabels(String[] names,
String bundle)
Returns an array of labels for the supplied names, translating those that have translations. |
String |
getMousePath()
Returns the path of the property under the mouse cursor relative to this property. |
protected String |
getMousePath(Point pt)
Returns the path of the property under the mouse cursor relative to this property. |
protected int |
getPropertyColor(Property[] lineage)
|
protected Icon |
loadIcon(String name,
EditorContext ctx)
Loads the named icon. |
protected void |
makeCollapsible(EditorContext ctx,
String title)
Adds the collapsible button to the panel. |
void |
removeChangeListener(ChangeListener listener)
Removes a change event listener. |
protected void |
updateBorder(String title)
Updates the border. |
| Methods inherited from class com.samskivert.swing.CollapsiblePanel |
|---|
getContent, isCollapsed, setCollapsed, setGap, setTrigger, setTriggerContainer, setTriggerContainer, setTriggerContainer |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected EditorContext _ctx
protected MessageManager _msgmgr
protected MessageBundle _msgs
protected JButton _highlight
protected boolean _highlighted
protected static Icon _expandIcon
protected static Icon _collapseIcon
protected static Icon _highlightIcon
protected static final int BASE_BACKGROUND
protected static final int DEFAULT_BACKGROUND
protected static final int SHADE_DECREMENT
protected static final Dimension PANEL_BUTTON_SIZE
| Constructor Detail |
|---|
public BasePropertyEditor()
| Method Detail |
|---|
public void addChangeListener(ChangeListener listener)
public void removeChangeListener(ChangeListener listener)
public String getLabel(Class<?> type)
public String[] getLabels(String[] names)
public String[] getLabels(String[] names,
String bundle)
public String[] getLabels(String[] names,
MessageBundle msgs)
public String getMousePath()
public void actionPerformed(ActionEvent event)
actionPerformed in interface ActionListeneractionPerformed in class CollapsiblePanelprotected String getMousePath(Point pt)
pt - the location of the mouse cursor.protected String getLabel(String name)
protected String getLabel(String name,
String bundle)
protected String getLabel(String name,
MessageBundle msgs)
protected void fireStateChanged()
protected void makeCollapsible(EditorContext ctx,
String title)
protected Icon loadIcon(String name,
EditorContext ctx)
protected JButton createButton(Icon icon)
protected int getColor(String name)
protected int getColor(String name,
String bundle,
int defaultColor)
protected int getColor(String name,
MessageBundle msgs,
int defaultColor)
protected int getPropertyColor(Property[] lineage)
protected Color getDarkerBackground(float shades)
protected Color getBackgroundColor(Property[] lineage)
protected Color darkenColor(int color,
float shades)
protected void copyPropertyPath(String path)
protected void updateBorder(String title)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||