[Bprocessor-commit] gui/src/net/sourceforge/bprocessor/gui/attrview AttributeView.java,1.23,1.24 MyK
Status: Pre-Alpha
Brought to you by:
henryml
From: Nikolaj B. <nbr...@us...> - 2006-01-18 10:12:48
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2658/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java MyKeyListener.java Log Message: Updated the attribute view for Surfaces to now also display space assignments. Index: MyKeyListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/MyKeyListener.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MyKeyListener.java 13 Jan 2006 09:29:29 -0000 1.4 --- MyKeyListener.java 18 Jan 2006 10:12:39 -0000 1.5 *************** *** 19,26 **** /** If its a textfield */ ! public static final String TFIELD = "Textfield"; /** If its a textfield */ ! public static final String TAREA = "Textarea"; /** The current ConstructionSpace */ --- 19,26 ---- /** If its a textfield */ ! public static final int TFIELD = 1; /** If its a textfield */ ! public static final int TAREA = 2; /** The current ConstructionSpace */ *************** *** 34,38 **** /** The type of component */ ! private String type; /** --- 34,38 ---- /** The type of component */ ! private int type; /** *************** *** 41,45 **** * @param type shows the type of the component the listeners listens too. */ ! public MyKeyListener (Object o, String type) { current = o; this.type = type; --- 41,45 ---- * @param type shows the type of the component the listeners listens too. */ ! public MyKeyListener (Object o, int type) { current = o; this.type = type; Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** AttributeView.java 16 Jan 2006 09:01:21 -0000 1.23 --- AttributeView.java 18 Jan 2006 10:12:39 -0000 1.24 *************** *** 16,19 **** --- 16,20 ---- import java.awt.Color; import java.awt.Dimension; + import java.awt.Font; import java.awt.GridBagLayout; import java.awt.GridBagConstraints; *************** *** 75,84 **** /** Current object */ private Object current; /** If its a textfield */ ! public static final String TFIELD = "Textfield"; /** If its a textfield */ ! public static final String TAREA = "Textarea"; /** --- 76,91 ---- /** Current object */ private Object current; + + /** The font used in plain */ + private Font fontPlain = new Font("Sans-serif", Font.PLAIN, 12); + /** The font used in bold */ + private Font fontBold = new Font("Sans-serif", Font.BOLD, 12); + /** If its a textfield */ ! public static final int TFIELD = 1; /** If its a textfield */ ! public static final int TAREA = 2; /** *************** *** 102,107 **** --- 109,116 ---- con.weightx = 0; layout.setConstraints(name, con); + name.setFont(fontBold); add(name); + JTextField nameEdit = new JTextField(o.getName()); con.gridwidth = GridBagConstraints.REMAINDER; *************** *** 109,112 **** --- 118,122 ---- con.fill = GridBagConstraints.HORIZONTAL; layout.setConstraints(nameEdit, con); + nameEdit.setFont(fontPlain); add(nameEdit); nameEdit.addKeyListener(new MyKeyListener(o, TFIELD)); *************** *** 203,210 **** --- 213,222 ---- con.weightx = 0; layout.setConstraints(name, con); + name.setFont(fontBold); add(name); JLabel surfaceName = new JLabel(o.getName()); layout.setConstraints(surfaceName, con); + surfaceName.setFont(fontPlain); add(surfaceName); *************** *** 214,225 **** con.gridwidth = GridBagConstraints.REMAINDER; layout.setConstraints(hfiller, con); ! add(hfiller); JLabel fcolor = new JLabel("Front: "); con.weightx = 0; ! con.gridwidth = 1; layout.setConstraints(fcolor, con); add(fcolor); { float[] frontColor = getFrontColor(o); --- 226,267 ---- con.gridwidth = GridBagConstraints.REMAINDER; layout.setConstraints(hfiller, con); ! add(hfiller); ! ! JLabel emptyLine = new JLabel(" "); ! con.weightx = 1; ! con.gridwidth = GridBagConstraints.REMAINDER; ! layout.setConstraints(emptyLine, con); ! add(emptyLine); JLabel fcolor = new JLabel("Front: "); con.weightx = 0; ! con.gridwidth = GridBagConstraints.REMAINDER; layout.setConstraints(fcolor, con); + fcolor.setFont(fontBold); add(fcolor); + + JLabel fspace = new JLabel("Space: "); + con.weightx = 0; + con.gridwidth = 1; + layout.setConstraints(fspace, con); + fspace.setFont(fontBold); + add(fspace); + + String fsn; + if (o.getFrontDomain() == null) { + fsn = "None"; + } else { + fsn = o.getFrontDomain().getName(); + } + + JLabel frontSpaceName = new JLabel(fsn); + layout.setConstraints(frontSpaceName, con); + con.weightx = 1; + con.gridwidth = GridBagConstraints.REMAINDER; + layout.setConstraints(frontSpaceName, con); + frontSpaceName.setFont(fontPlain); + add(frontSpaceName); + { float[] frontColor = getFrontColor(o); *************** *** 237,247 **** } JLabel bcolor = new JLabel("Back: "); con.weightx = 0; ! con.fill = GridBagConstraints.NONE; ! con.gridwidth = 1; layout.setConstraints(bcolor, con); ! add(bcolor); { float[] backColor = getBackColor(o); --- 279,318 ---- } + JLabel el = new JLabel(" "); + con.weightx = 1; + con.fill = GridBagConstraints.NONE; + con.gridwidth = GridBagConstraints.REMAINDER; + layout.setConstraints(el, con); + add(el); + JLabel bcolor = new JLabel("Back: "); con.weightx = 0; ! con.gridwidth = GridBagConstraints.REMAINDER; layout.setConstraints(bcolor, con); ! bcolor.setFont(fontBold); ! add(bcolor); ! ! JLabel bspace = new JLabel("Space: "); ! con.weightx = 0; ! con.gridwidth = 1; ! layout.setConstraints(bspace, con); ! bspace.setFont(fontBold); ! add(bspace); + String bsn; + if (o.getBackDomain() == null) { + bsn = "None"; + } else { + bsn = o.getBackDomain().getName(); + } + + JLabel backSpaceName = new JLabel(bsn); + layout.setConstraints(backSpaceName, con); + con.weightx = 1; + con.gridwidth = GridBagConstraints.REMAINDER; + layout.setConstraints(backSpaceName, con); + backSpaceName.setFont(fontPlain); + add(backSpaceName); + { float[] backColor = getBackColor(o); |