Author: mvw
Date: 2007-11-10 11:11:44-0800
New Revision: 13746
Modified:
trunk/src_new/org/argouml/ui/NavigatorPane.java
trunk/src_new/org/argouml/ui/TabText.java
Log:
Replaced the use of deprecated functions.
Modified: trunk/src_new/org/argouml/ui/NavigatorPane.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/NavigatorPane.java?view=diff&rev=13746&p1=trunk/src_new/org/argouml/ui/NavigatorPane.java&p2=trunk/src_new/org/argouml/ui/NavigatorPane.java&r1=13745&r2=13746
==============================================================================
--- trunk/src_new/org/argouml/ui/NavigatorPane.java (original)
+++ trunk/src_new/org/argouml/ui/NavigatorPane.java 2007-11-10 11:11:44-0800
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-2007 The Regents of the University of California. All
// Rights Reserved. Permission to use, copy, modify, and distribute this
// software and its documentation without fee, and without a written
// agreement is hereby granted, provided that the above copyright notice
@@ -26,10 +26,13 @@
import java.awt.BorderLayout;
import java.awt.Dimension;
+import java.util.ArrayList;
+import java.util.Collection;
import javax.swing.JComboBox;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
+import javax.swing.JToolBar;
import org.argouml.i18n.Translator;
import org.argouml.ui.explorer.ActionPerspectiveConfig;
@@ -40,7 +43,7 @@
import org.argouml.ui.explorer.PerspectiveComboBox;
import org.argouml.ui.explorer.PerspectiveManager;
import org.argouml.ui.explorer.TypeThenNameOrder;
-import org.tigris.toolbar.ToolBar;
+import org.tigris.toolbar.ToolBarFactory;
/**
* The upper-left pane of the main ArgoUML window, contains a tree view
@@ -53,9 +56,6 @@
class NavigatorPane
extends JPanel {
- ////////////////////////////////////////////////////////////////
- // constructors
-
/**
* Constructs a new navigator panel.<p>
*
@@ -71,20 +71,20 @@
JComboBox perspectiveCombo = new PerspectiveComboBox();
JComboBox orderByCombo = new JComboBox();
ExplorerTree tree = new DnDExplorerTree();
- ToolBar toolbar = new ToolBar();
+ Collection<Object> toolbarTools = new ArrayList<Object>();
+ toolbarTools.add(new ActionPerspectiveConfig());
+ toolbarTools.add(perspectiveCombo);
+ JToolBar toolbar = (new ToolBarFactory(toolbarTools)).createToolBar();
toolbar.setFloatable(false);
- toolbar.add(new ActionPerspectiveConfig());
- toolbar.add(perspectiveCombo);
-
- ToolBar toolbar2 = new ToolBar();
-
- toolbar2.setFloatable(false);
orderByCombo.addItem(new TypeThenNameOrder());
orderByCombo.addItem(new NameOrder());
- toolbar2.add(orderByCombo);
+ Collection<Object> toolbarTools2 = new ArrayList<Object>();
+ toolbarTools2.add(orderByCombo);
+ JToolBar toolbar2 = (new ToolBarFactory(toolbarTools2)).createToolBar();
+ toolbar2.setFloatable(false);
JPanel toolbarpanel = new JPanel();
toolbarpanel.setLayout(new BorderLayout());
@@ -106,9 +106,6 @@
PerspectiveManager.getInstance().loadUserPerspectives();
}
- ////////////////////////////////////////////////////////////////
- // methods
-
/*
* @see java.awt.Component#getMinimumSize()
*
Modified: trunk/src_new/org/argouml/ui/TabText.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/TabText.java?view=diff&rev=13746&p1=trunk/src_new/org/argouml/ui/TabText.java&p2=trunk/src_new/org/argouml/ui/TabText.java&r1=13745&r2=13746
==============================================================================
--- trunk/src_new/org/argouml/ui/TabText.java (original)
+++ trunk/src_new/org/argouml/ui/TabText.java 2007-11-10 11:11:44-0800
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-2007 The Regents of the University of California. All
// Rights Reserved. Permission to use, copy, modify, and distribute this
// software and its documentation without fee, and without a written
// agreement is hereby granted, provided that the above copyright notice
@@ -26,6 +26,7 @@
import java.awt.BorderLayout;
import java.awt.Font;
+import java.util.Collections;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
@@ -38,7 +39,7 @@
import org.argouml.ui.targetmanager.TargetEvent;
import org.argouml.ui.targetmanager.TargetManager;
import org.argouml.uml.ui.TabModelTarget;
-import org.tigris.toolbar.ToolBar;
+import org.tigris.toolbar.ToolBarFactory;
/**
* A tab that contains textual information.
@@ -46,8 +47,7 @@
public class TabText
extends AbstractArgoJPanel
implements TabModelTarget, DocumentListener {
- ////////////////////////////////////////////////////////////////
- // instance variables
+
private Object target;
private JTextArea textArea = new JTextArea();
private boolean parseChanges = true;
@@ -64,9 +64,6 @@
*/
private static final Logger LOG = Logger.getLogger(TabText.class);
- ////////////////////////////////////////////////////////////////
- // constructor
-
/**
* Create a text tab without a toolbar.
*
@@ -93,15 +90,15 @@
// If a toolbar was requested, create an empty one.
if (withToolbar) {
- toolbar = new ToolBar();
+ toolbar = (new ToolBarFactory(Collections.EMPTY_LIST))
+ .createToolBar();
toolbar.setOrientation(SwingConstants.HORIZONTAL);
+ toolbar.setFloatable(false);
toolbar.setName(getTitle());
add(toolbar, BorderLayout.NORTH);
}
}
- ////////////////////////////////////////////////////////////////
- // accessors
private void doGenerateText() {
parseChanges = false;
@@ -191,9 +188,6 @@
LOG.debug("parsing text:" + s);
}
- ////////////////////////////////////////////////////////////////
- // event handlers
-
/*
* @see javax.swing.event.DocumentListener#insertUpdate(javax.swing.event.DocumentEvent)
*/
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.