|
|||||||||||
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.argouml.ui.TabSpawnable
org.argouml.ui.StylePanel
org.argouml.ui.StylePanelFig
The basic stylepanel which provides line and fill color information.
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
private JTextField |
bboxField
|
private JLabel |
bboxLabel
|
private static String |
CUSTOM_ITEM
|
private JComboBox |
fillField
|
private JLabel |
fillLabel
|
private JComboBox |
lineField
|
private JLabel |
lineLabel
|
private static Logger |
LOG
|
private SpacerPanel |
spacer
|
private SpacerPanel |
spacer2
|
private SpacerPanel |
spacer3
|
Fields inherited from class org.argouml.ui.StylePanel |
|
Fields inherited from class org.argouml.ui.TabSpawnable |
|
Fields inherited from class javax.swing.JPanel |
|
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.Container |
|
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 | |
StylePanelFig()
The constructor. |
|
StylePanelFig(String title)
The constructor of the style panel of a Fig. |
Method Summary | |
void |
focusGained(FocusEvent e)
|
void |
focusLost(FocusEvent e)
Makes sure that the fig is updated when the _bboxField loses focus. |
protected JTextField |
getBBoxField()
|
protected JLabel |
getBBoxLabel()
|
protected JComboBox |
getFillField()
|
protected JLabel |
getFillLabel()
|
protected JComboBox |
getLineField()
|
protected JLabel |
getLineLabel()
|
protected SpacerPanel |
getSpacer()
|
protected SpacerPanel |
getSpacer2()
|
protected SpacerPanel |
getSpacer3()
|
protected void |
handleCustomColor(JComboBox field,
String title,
Color targetColor)
Prompts the user for a new custom color and adds that color to the combo box. |
protected void |
hasEditableBoundingBox(boolean value)
set whether this Fig has a editable boundingbox. |
protected void |
initChoices()
Fill in the user-choices. |
void |
itemStateChanged(ItemEvent e)
|
void |
keyPressed(KeyEvent e)
|
void |
keyReleased(KeyEvent e)
|
void |
keyTyped(KeyEvent e)
Tests if enter is pressed in the _bbodField so we need to set the target bounds. |
protected Rectangle |
parseBBox()
Parse the boundary box string and return the rectangle it represents. |
void |
refresh()
Handle a refresh of the style panel after the fig has moved. |
protected void |
setTargetBBox()
Change the bounds of the target fig. |
void |
setTargetFill()
Change the fill. |
void |
setTargetLine()
Change the line. |
Methods inherited from class org.argouml.ui.StylePanel |
actionPerformed, changedUpdate, getPanelTarget, getTarget, insertUpdate, refresh, removeUpdate, setTarget, shouldBeEnabled, targetAdded, targetRemoved, targetSet, valueChanged |
Methods inherited from class org.argouml.ui.TabSpawnable |
clone, getOrientation, getTitle, setOrientation, setTitle, spawn |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final Logger LOG
private static final String CUSTOM_ITEM
private JLabel bboxLabel
private JTextField bboxField
private JLabel fillLabel
private JComboBox fillField
private JLabel lineLabel
private JComboBox lineField
private SpacerPanel spacer
private SpacerPanel spacer2
private SpacerPanel spacer3
Constructor Detail |
public StylePanelFig(String title)
title
- the title stringpublic StylePanelFig()
Method Detail |
protected void initChoices()
protected void hasEditableBoundingBox(boolean value)
refresh()
, e.g. for FigEdgeModelElements where it does
not make sense to edit the bounding box.
value
- the boolean value of the bounding box propertypublic void refresh()
Warning. There is a circular trap here. Editing the boundary box will also trigger a refresh, and so we reset the boundary box, which causes funny behaviour (the cursor keeps jumping to the end of the text). The solution is to not reset the boundary box field if the boundaries have not changed.
refresh
in interface TabTarget
refresh
in class StylePanel
TabTarget.refresh()
protected void setTargetBBox()
Format of the bounds is four integers representing x, y, width and height separated by spaces or commas. An empty field is treated as no change and leading and trailing spaces are ignored.
Note. There is a note in the old code that more work might be needed, because this could change the graph model. I don't see how that could ever be.
protected Rectangle parseBBox()
The syntax are four integers separated by spaces or commas. We ignore leading and trailing blanks.
If we have the empty string we return null
.
If we fail to parse, then we return null
and print
out a rude message.
null
if the bounds string
is empty or invalid.protected void handleCustomColor(JComboBox field, String title, Color targetColor)
field
- the combobox to enter a new color fortitle
- the title for the dialog boxtargetColor
- the initial Color set when the color-chooser is shownpublic void setTargetFill()
public void setTargetLine()
public void itemStateChanged(ItemEvent e)
itemStateChanged
in interface ItemListener
itemStateChanged
in class StylePanel
ItemListener.itemStateChanged(java.awt.event.ItemEvent)
public void focusGained(FocusEvent e)
focusGained
in interface FocusListener
FocusListener.focusGained(java.awt.event.FocusEvent)
public void focusLost(FocusEvent e)
focusLost
in interface FocusListener
FocusListener.focusLost(java.awt.event.FocusEvent)
public void keyPressed(KeyEvent e)
keyPressed
in interface KeyListener
KeyListener.keyPressed(java.awt.event.KeyEvent)
public void keyReleased(KeyEvent e)
keyReleased
in interface KeyListener
KeyListener.keyReleased(java.awt.event.KeyEvent)
public void keyTyped(KeyEvent e)
keyTyped
in interface KeyListener
KeyListener.keyTyped(java.awt.event.KeyEvent)
protected JLabel getBBoxLabel()
protected JTextField getBBoxField()
protected JLabel getFillLabel()
protected JComboBox getFillField()
protected JLabel getLineLabel()
protected JComboBox getLineField()
protected SpacerPanel getSpacer()
protected SpacerPanel getSpacer2()
protected SpacerPanel getSpacer3()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20050222) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |