From: <aki...@us...> - 2006-12-15 20:45:23
|
Revision: 1078 http://svn.sourceforge.net/gridarta/?rev=1078&view=rev Author: akirschbaum Date: 2006-12-15 12:45:23 -0800 (Fri, 15 Dec 2006) Log Message: ----------- Unify code. Modified Paths: -------------- trunk/daimonin/src/daieditor/CArchPanel.java trunk/daimonin/src/daieditor/CArchPanelPan.java Modified: trunk/daimonin/src/daieditor/CArchPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CArchPanel.java 2006-12-15 20:36:27 UTC (rev 1077) +++ trunk/daimonin/src/daieditor/CArchPanel.java 2006-12-15 20:45:23 UTC (rev 1078) @@ -57,7 +57,7 @@ private final ToolSelectorPane toolSelectorPane = new ToolSelectorPane(); /** - * Name of the selected arch. + * Name of the selected archetype. * @serial include */ private String selectedArch; @@ -92,8 +92,8 @@ // archAndPickPane is the panel containing both archpanel and pickmaps archAndPickPane = new JTabbedPane(SwingConstants.TOP); - archAndPickPane.addTab(" Arch List ", tabDesktop); - archAndPickPane.addTab(" Pickmaps ", mainControl.getMainView().getPickmapPanel()); + archAndPickPane.addTab("Arch List", tabDesktop); + archAndPickPane.addTab("Pickmaps", mainControl.getMainView().getPickmapPanel()); // this listener informs the mainview which panel is active: archlist or pickmaps? CPickmapPanel.getInstance().addArchNPickChangeListener(archAndPickPane); @@ -138,8 +138,8 @@ return selectedPanel.addArchPanelCombo(name); } - public void addArchPanelArch(final String archname, final int index) { - selectedPanel.addArchPanelArch(archname, index); + public void addArchPanelArch(final String archetypeName, final int index) { + selectedPanel.addArchPanelArch(archetypeName, index); } /** @@ -179,7 +179,7 @@ this.selectedArch = selectedArch; } - void refresh() { + public void refresh() { archQuickPanel.refresh(); repaint(); } Modified: trunk/daimonin/src/daieditor/CArchPanelPan.java =================================================================== --- trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-12-15 20:36:27 UTC (rev 1077) +++ trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-12-15 20:45:23 UTC (rev 1078) @@ -62,7 +62,7 @@ /** Controller of this subview. */ private final CMainControl mainControl; - /** List of index-archname pairs. */ + /** List of index-archetype name pairs. */ private List<PanelEntry> archList = new ArrayList<PanelEntry>(); private final JList theList; @@ -71,7 +71,7 @@ private final JPanel panelDesktop; - private final JComboBox jbox; + private final JComboBox comboBox; private int comboCounter; @@ -91,7 +91,7 @@ panelDesktop = new JPanel(); panelDesktop.setLayout(new BorderLayout()); - jbox = new JComboBox(); + comboBox = new JComboBox(); model = new DefaultListModel(); theList = new JList(model); @@ -99,13 +99,13 @@ theList.setBackground(IGUIConstants.BG_COLOR); final JScrollPane scrollPane = new JScrollPane(theList); panelDesktop.add(scrollPane, BorderLayout.CENTER); - panelDesktop.add(jbox, BorderLayout.NORTH); + panelDesktop.add(comboBox, BorderLayout.NORTH); scrollPane.setAutoscrolls(true); scrollPane.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); - jbox.setAutoscrolls(true); + comboBox.setAutoscrolls(true); - jbox.addActionListener(new ActionListener() { + comboBox.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { showArchList(); } @@ -174,16 +174,23 @@ /** * Add this arch to list of (this) Jlist list. - * @param archname name of the arch to add + * @param archetypeName name of the archetype to add * @param index index of subdir where to add */ - public void addArchPanelArch(final String archname, final int index) { - archList.add(new PanelEntry(index, archname)); + public void addArchPanelArch(final String archetypeName, final int index) { + archList.add(new PanelEntry(index, archetypeName)); } - int addArchPanelCombo(final String name) { + /** + * Add a new category to the combo box. + * + * @param name the name of the combo box to create + * + * @return the combo box index + */ + public int addArchPanelCombo(final String name) { setEnabled(false); - jbox.addItem(name); + comboBox.addItem(name); setEnabled(true); return comboCounter++; } @@ -197,7 +204,7 @@ } void showArchList() { - final int index = jbox.getSelectedIndex(); + final int index = comboBox.getSelectedIndex(); model.removeAllElements(); for (PanelEntry p : archList) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |