[Jsmooth-cvs] jsmooth/src/net/charabia/jsmoothgen/application/gui Editor.java, 1.2, 1.3 MasterPanel
Status: Beta
Brought to you by:
reyes
From: Rodrigo R. <re...@us...> - 2007-04-06 16:27:16
|
Update of /cvsroot/jsmooth/jsmooth/src/net/charabia/jsmoothgen/application/gui In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12017/src/net/charabia/jsmoothgen/application/gui Modified Files: Editor.java MasterPanel.java Log Message: adds welcome panel Index: MasterPanel.java =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/src/net/charabia/jsmoothgen/application/gui/MasterPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MasterPanel.java 27 Mar 2007 20:21:02 -0000 1.2 --- MasterPanel.java 6 Apr 2007 16:27:10 -0000 1.3 *************** *** 39,42 **** --- 39,43 ---- private JPanel m_mainpanel = new JPanel(); private JScrollBar m_mainpanelVBar; + private JScrollPane m_scrollpane; // private ResourceBundle m_texts; *************** *** 89,105 **** }; public MasterPanel() { setLayout(new BorderLayout()); ! add(BorderLayout.WEST, new JScrollPane(m_leftBar)); ! JScrollPane scp = new JScrollPane(m_mainpanel); ! m_mainpanelVBar = scp.getVerticalScrollBar(); add(BorderLayout.CENTER, scp); scp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); ! ! // PanelLayout pl = new PanelLayout(); ! // m_mainpanel.setLayout(pl); m_mainpanel.setLayout(new RiverLayout()); addAction("Skeleton", "/icons/stock_new-template.png", m_skelElements); addAction("Executable", "/icons/stock_autopilot-24.png", m_execElements); --- 90,109 ---- }; + private Object[] m_jsInfo = { + new net.charabia.jsmoothgen.application.gui.editors.JSmoothInfo() + }; + public MasterPanel() { setLayout(new BorderLayout()); ! add(BorderLayout.WEST, m_scrollpane = new JScrollPane(m_leftBar)); ! JScrollPane scp = new JScrollPane(m_mainpanel); ! m_mainpanelVBar = scp.getVerticalScrollBar(); add(BorderLayout.CENTER, scp); scp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); ! // add(BorderLayout.CENTER, m_mainpanel); m_mainpanel.setLayout(new RiverLayout()); + addAction("Welcome", "/icons/stock_form-properties.png", m_jsInfo); addAction("Skeleton", "/icons/stock_new-template.png", m_skelElements); addAction("Executable", "/icons/stock_autopilot-24.png", m_execElements); *************** *** 108,112 **** addAction("JVM Configuration", "/icons/stock_form-properties.png", m_jvmCfgElements); ! // m_texts = PropertyResourceBundle.getBundle("locale.Texts"); } --- 112,116 ---- addAction("JVM Configuration", "/icons/stock_form-properties.png", m_jvmCfgElements); ! setupPanel(m_jsInfo); } *************** *** 173,186 **** } ! // Editor ed = (Editor)els[i].newInstance(); ! ! // OptionalHelpPanel help = new OptionalHelpPanel(); ! // help.getContentPane().setLayout(new BorderLayout()); ! // help.getContentPane().add(BorderLayout.CENTER, ed); ! // help.setLabel(getLocaleText(ed.getLabel())); ! // help.setHelpText(getLocaleText(ed.getDescription())); ! // m_mainpanel.add("p left hfill", help); ! ! if (ed.needsBigSpace()) { javax.swing.border.TitledBorder title = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.LOWERED), getLocaleText(ed.getLabel())); --- 177,192 ---- } ! if (ed.needsFullSpace()) ! { ! pgroup.add("left hfill vfill", ed); ! String gc = "br hfill vfill"; ! m_mainpanel.add(gc, ed); ! ed.setMaximumSize(new java.awt.Dimension(300,300)); ! m_mainpanel.add("tab", new JLabel("...")); ! pgroup = null; ! // m_scrollpane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); ! //m_scrollpane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); ! } ! else if (ed.needsBigSpace()) { javax.swing.border.TitledBorder title = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.LOWERED), getLocaleText(ed.getLabel())); *************** *** 196,211 **** else { ! pgroup.add("br left", new JLabel(getLocaleText(ed.getLabel()))); ! pgroup.add("tab", new HelpButton(getLocaleText(ed.getDescription()))); ! pgroup.add("tab hfill", ed); } - // jp.setBorder(title); - // jp.setLayout(new BorderLayout()); - // jp.add(ed, BorderLayout.CENTER); - // m_mainpanel.add("p left hfill", jp); - // m_mainpanel.add("p left", new JLabel(ed.getLabel())); - // m_mainpanel.add("tab hfill", ed); - m_displayedElements.add(ed); } --- 202,217 ---- else { ! if (ed.useDescription()) ! { ! pgroup.add("br left", new JLabel(getLocaleText(ed.getLabel()))); ! pgroup.add("tab", new HelpButton(getLocaleText(ed.getDescription()))); ! pgroup.add("tab hfill", ed); ! } ! else ! { ! pgroup.add("left hfill", ed); ! } } m_displayedElements.add(ed); } Index: Editor.java =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/src/net/charabia/jsmoothgen/application/gui/Editor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Editor.java 27 Mar 2007 20:21:02 -0000 1.2 --- Editor.java 6 Apr 2007 16:27:10 -0000 1.3 *************** *** 66,69 **** --- 66,79 ---- } + public boolean needsFullSpace() + { + return false; + } + + public boolean useDescription() + { + return true; + } + protected java.io.File getAbsolutePath(java.io.File f) { |