Changeset 4381
- Timestamp:
- 01/11/08 00:46:48 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/java/lib2chj/trunk/lib2chj/src/main/java/lib2chj/SimpleGUI.java
- Property svn:keywords set to LastChangedDate LastChangedRevision
r4237 r4381 38 38 import javax.swing.JList; 39 39 import javax.swing.JScrollPane; 40 import javax.swing.JTree; 40 41 import javax.swing.UIManager; 41 42 import javax.swing.border.Border; … … 59 60 public class SimpleGUI 60 61 extends JFrame { 62 63 private JTree menutree; 64 61 65 private JList menulist; 62 66 … … 82 86 throws HeadlessException { 83 87 super(); 88 89 menutree = new JTree( menu.toArray() ) { 90 @Override 91 public String convertValueToText( Object value, boolean selected, boolean expanded, boolean leaf, int row, 92 boolean hasFocus ) { 93 if ( value != null ) { 94 if ( value instanceof DynamicUtilTreeNode ) { 95 DynamicUtilTreeNode node = (DynamicUtilTreeNode) value; 96 Object text = null; 97 try { 98 Object target = node.getUserObject(); 99 Method m = target.getClass().getMethod( "view" ); 100 text = m.invoke( target ); 101 } 102 catch ( Exception e ) { 103 e.printStackTrace(); 104 } 105 if ( text == null ) { 106 return ( ( value == null ) ? "" : value.toString() ); 107 } 108 else { 109 return ( text.toString() ); 110 } 111 } 112 else { 113 return value.toString(); 114 } 115 } 116 else { 117 return ""; 118 } 119 } 120 }; 84 121 85 122 menulist = new JList( menu.toArray() ); … … 188 225 subjectlist.addMouseListener( mouseListener3 ); 189 226 227 menutree.setFont( new Font( "Serif", Font.PLAIN, 12 ) ); 190 228 menulist.setFont( new Font( "Serif", Font.PLAIN, 12 ) ); 191 229 italist.setFont( new Font( "Serif", Font.PLAIN, 12 ) ); … … 193 231 commentlist.setFont( new Font( "MS ゴシック", Font.PLAIN, 12 ) ); 194 232 233 this.add( menutree, BorderLayout.NORTH ); 195 234 this.add( menulist, BorderLayout.WEST ); 196 235 this.add( italist, BorderLayout.CENTER ); … … 209 248 JScrollPane scroll4 = new JScrollPane( commentlist ); 210 249 this.add( scroll4, BorderLayout.SOUTH ); 250 251 JScrollPane scroll5 = new JScrollPane( menutree ); 252 this.add( scroll5, BorderLayout.NORTH ); 211 253 212 254 this.setSize( new Dimension( 800, 600 ) );
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)