Revision: 4736
          http://sourceforge.net/p/jump-pilot/code/4736
Author:   edso
Date:     2016-01-02 15:46:40 +0000 (Sat, 02 Jan 2016)
Log Message:
-----------
allow setting taskmonitor dialogues title via TaskMonitorV2 interface
always center taskmonitor panel contents

Modified Paths:
--------------
    
core/trunk/src/com/vividsolutions/jump/workbench/ui/task/TaskMonitorDialog.java

Added Paths:
-----------
    core/trunk/src/com/vividsolutions/jump/task/TaskMonitorUtil.java
    core/trunk/src/com/vividsolutions/jump/task/TaskMonitorV2.java

Added: core/trunk/src/com/vividsolutions/jump/task/TaskMonitorUtil.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/task/TaskMonitorUtil.java            
                (rev 0)
+++ core/trunk/src/com/vividsolutions/jump/task/TaskMonitorUtil.java    
2016-01-02 15:46:40 UTC (rev 4736)
@@ -0,0 +1,15 @@
+package com.vividsolutions.jump.task;
+
+
+public class TaskMonitorUtil {
+
+  /**
+   * set the title on nextgen {@link TaskMonitorV2}
+   * @param monitor
+   * @param title
+   */
+  public static void setTitle( TaskMonitor monitor, String title ){
+    if (monitor instanceof TaskMonitorV2)
+      ((TaskMonitorV2)monitor).setTitle(title);
+  }
+}


Property changes on: 
core/trunk/src/com/vividsolutions/jump/task/TaskMonitorUtil.java
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: core/trunk/src/com/vividsolutions/jump/task/TaskMonitorV2.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/task/TaskMonitorV2.java              
                (rev 0)
+++ core/trunk/src/com/vividsolutions/jump/task/TaskMonitorV2.java      
2016-01-02 15:46:40 UTC (rev 4736)
@@ -0,0 +1,38 @@
+
+/*
+ * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI 
+ * for visualizing and manipulating spatial features with geometry and 
attributes.
+ *
+ * Copyright (C) 2003 Vivid Solutions
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ * 
+ * For more information, contact:
+ *
+ * Vivid Solutions
+ * Suite #1A
+ * 2328 Government Street
+ * Victoria BC  V8T 5G5
+ * Canada
+ *
+ * (250)385-6040
+ * www.vividsolutions.com
+ */
+
+package com.vividsolutions.jump.task;
+
+public interface TaskMonitorV2 extends TaskMonitor{
+  public void setTitle( String title );
+}


Property changes on: 
core/trunk/src/com/vividsolutions/jump/task/TaskMonitorV2.java
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: 
core/trunk/src/com/vividsolutions/jump/workbench/ui/task/TaskMonitorDialog.java
===================================================================
--- 
core/trunk/src/com/vividsolutions/jump/workbench/ui/task/TaskMonitorDialog.java 
    2015-12-31 19:28:56 UTC (rev 4735)
+++ 
core/trunk/src/com/vividsolutions/jump/workbench/ui/task/TaskMonitorDialog.java 
    2016-01-02 15:46:40 UTC (rev 4736)
@@ -50,12 +50,12 @@
 import javax.swing.Timer;
 
 import com.vividsolutions.jump.I18N;
-import com.vividsolutions.jump.task.TaskMonitor;
+import com.vividsolutions.jump.task.TaskMonitorV2;
 import com.vividsolutions.jump.workbench.ui.AnimatedClockPanel;
 import com.vividsolutions.jump.workbench.ui.ErrorHandler;
 
 
-public class TaskMonitorDialog extends JDialog implements TaskMonitor {
+public class TaskMonitorDialog extends JDialog implements TaskMonitorV2 {
     JPanel mainPanel = new JPanel();
     private GridBagLayout gridBagLayout1 = new GridBagLayout();
     private JPanel labelPanel = new JPanel();
@@ -85,6 +85,7 @@
         this.errorHandler = errorHandler;
 
         try {
+          this.setLayout(new GridBagLayout());
             jbInit();
             pack();
         } catch (Exception ex) {
@@ -117,14 +118,10 @@
                     this_componentHidden(e);
                 }
             });
-        this.getContentPane().setLayout(gridBagLayout2);
+        this.getContentPane().setLayout(new GridBagLayout());
         labelPanel.setLayout(gridBagLayout3);
         
subtaskProgressLabel.setText(I18N.get("ui.task.TaskMonitorDialog.subtask-progress-goes-here"));
         
taskProgressLabel.setText(I18N.get("ui.task.TaskMonitorDialog.task-progress-goes-here"));
-        getContentPane().add(mainPanel,
-            new GridBagConstraints(1, 0, 1, 1, 1.0, 1.0,
-                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                new Insets(15, 0, 15, 15), 0, 0));
         mainPanel.add(labelPanel,
             new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
                 GridBagConstraints.WEST, GridBagConstraints.BOTH,
@@ -141,10 +138,18 @@
             new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
                 GridBagConstraints.CENTER, GridBagConstraints.NONE,
                 new Insets(0, 0, 0, 0), 0, 0));
-        this.getContentPane().add(clockPanel,
+        
+        JPanel centerPanel = new JPanel(new GridBagLayout());
+        centerPanel.add(clockPanel,
             new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
                 GridBagConstraints.CENTER, GridBagConstraints.NONE,
                 new Insets(4, 4, 4, 4), 0, 0));
+        centerPanel.add(mainPanel,
+            new GridBagConstraints(1, 0, 1, 1, 1.0, 1.0,
+                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+                new Insets(15, 0, 15, 15), 0, 0));
+        
+        this.getContentPane().add(centerPanel);
     }
 
     void cancelButton_actionPerformed(ActionEvent e) {
@@ -203,4 +208,8 @@
     public boolean isCancelRequested() {
         return cancelled;
     }
+
+    public void setTitle(String title){
+      super.setTitle(title);
+    }
 }


------------------------------------------------------------------------------
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to