Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4812/src/net/sourceforge/bprocessor/gui/attrview
Modified Files:
DescriptionAttribute.java
Log Message:
Fixed some minor bugs in the description area
Index: DescriptionAttribute.java
===================================================================
RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/DescriptionAttribute.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DescriptionAttribute.java 28 Feb 2006 02:25:48 -0000 1.1
--- DescriptionAttribute.java 7 Mar 2006 23:03:18 -0000 1.2
***************
*** 10,13 ****
--- 10,15 ----
import java.awt.Color;
import java.awt.Dimension;
+ import java.awt.event.FocusEvent;
+ import java.awt.event.FocusListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
***************
*** 28,32 ****
* The StringAttributeView
*/
! public class DescriptionAttribute extends GenericAttribute implements MouseListener {
/** The listeners */
--- 30,34 ----
* The StringAttributeView
*/
! public class DescriptionAttribute extends GenericAttribute implements MouseListener, FocusListener {
/** The listeners */
***************
*** 45,48 ****
--- 47,53 ----
private JTextArea descriptionEditor;
+ /** The defualt background color */
+ private Color bgcolor;
+
***************
*** 59,62 ****
--- 64,68 ----
label = createLabel(attribute.getName());
+ bgcolor = label.getBackground();
Box header = Box.createHorizontalBox();
Box column = Box.createVerticalBox();
***************
*** 142,146 ****
s = value.toString();
JTextArea valueLabel = new JTextArea(s);
! valueLabel.setBackground(new Color(204, 204, 204));
valueLabel.setLineWrap(true);
valueLabel.setWrapStyleWord(true);
--- 148,152 ----
s = value.toString();
JTextArea valueLabel = new JTextArea(s);
! valueLabel.setBackground(bgcolor);
valueLabel.setLineWrap(true);
valueLabel.setWrapStyleWord(true);
***************
*** 185,188 ****
--- 191,195 ----
descriptionEditor.setLineWrap(true);
descriptionEditor.setWrapStyleWord(true);
+ descriptionEditor.addFocusListener(this);
component.add(descriptionEditor);
component.revalidate();
***************
*** 251,253 ****
--- 258,278 ----
*/
public void mouseExited(MouseEvent event) { }
+
+ /**
+ * Not in use
+ * @param event The FocusEvent
+ */
+ public void focusGained(FocusEvent event) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * StopEditing the description
+ * @param event The FocusEvent
+ */
+ public void focusLost(FocusEvent event) {
+ stopEditing();
+
+ }
}
|