Revision: 4610
          http://sourceforge.net/p/jump-pilot/code/4610
Author:   michaudm
Date:     2015-12-13 17:33:07 +0000 (Sun, 13 Dec 2015)
Log Message:
-----------
Improve user interface and add XBasicStyle management

Modified Paths:
--------------
    plug-ins/ViewManagerPlugin/trunk/build.xml
    
plug-ins/ViewManagerPlugin/trunk/resources/view_manager/language/jump.properties
    
plug-ins/ViewManagerPlugin/trunk/resources/view_manager/language/jump_fr.properties
    plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/View.java
    
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/ViewManagerPlugIn.java
    
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/ViewSet.java
    
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/ViewSetPanel.java
    
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/style/PBasicStyle.java
    
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/style/PColorThemingStyle.java

Added Paths:
-----------
    plug-ins/ViewManagerPlugin/trunk/resources/images/
    plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-bottom.png
    plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-down.png
    plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-top.png
    plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-up.png
    plug-ins/ViewManagerPlugin/trunk/resources/images/delete.png
    plug-ins/ViewManagerPlugin/trunk/resources/images/move-vertical.png
    plug-ins/ViewManagerPlugin/trunk/resources/images/replace.png

Modified: plug-ins/ViewManagerPlugin/trunk/build.xml
===================================================================
--- plug-ins/ViewManagerPlugin/trunk/build.xml  2015-12-13 15:02:36 UTC (rev 
4609)
+++ plug-ins/ViewManagerPlugin/trunk/build.xml  2015-12-13 17:33:07 UTC (rev 
4610)
@@ -48,6 +48,7 @@
             <fileset dir="${src}" casesensitive="false" includes="**/*.gif, 
**/*.jpg, **/*.png" />
             <fileset dir="${src}" casesensitive="false" 
includes="**/*.properties" />
             <fileset dir="${resources}" casesensitive="false" 
includes="**/*.properties" />
+            <fileset dir="${resources}" casesensitive="false" 
includes="**/*.gif, **/*.jpg, **/*.png" />
             <fileset dir="${src}" casesensitive="false" includes="**/*.html" />
             <fileset dir="${src}" casesensitive="false" includes="**/*.txt" />
             <fileset dir="${src}" casesensitive="false" 
includes="**/*.java2xml" />
@@ -83,6 +84,7 @@
             <include name="${dist}/*.jar" />
             <include name="${src}/org/openjump/ext/**/*.java" />
             <include name="${resources}/**/*.properties" />
+            <include name="${resources}/**/*.png" />
             <include name="build.xml" />
             <include name="ChangeLog" />
         </zip>

Added: plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-bottom.png
===================================================================
(Binary files differ)

Index: plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-bottom.png
===================================================================
--- plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-bottom.png  
2015-12-13 15:02:36 UTC (rev 4609)
+++ plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-bottom.png  
2015-12-13 17:33:07 UTC (rev 4610)

Property changes on: 
plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-bottom.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-down.png
===================================================================
(Binary files differ)

Index: plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-down.png
===================================================================
--- plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-down.png    
2015-12-13 15:02:36 UTC (rev 4609)
+++ plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-down.png    
2015-12-13 17:33:07 UTC (rev 4610)

Property changes on: 
plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-down.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-top.png
===================================================================
(Binary files differ)

Index: plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-top.png
===================================================================
--- plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-top.png     
2015-12-13 15:02:36 UTC (rev 4609)
+++ plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-top.png     
2015-12-13 17:33:07 UTC (rev 4610)

Property changes on: 
plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-top.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-up.png
===================================================================
(Binary files differ)

Index: plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-up.png
===================================================================
--- plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-up.png      
2015-12-13 15:02:36 UTC (rev 4609)
+++ plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-up.png      
2015-12-13 17:33:07 UTC (rev 4610)

Property changes on: 
plug-ins/ViewManagerPlugin/trunk/resources/images/arrow-up.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: plug-ins/ViewManagerPlugin/trunk/resources/images/delete.png
===================================================================
(Binary files differ)

Index: plug-ins/ViewManagerPlugin/trunk/resources/images/delete.png
===================================================================
--- plug-ins/ViewManagerPlugin/trunk/resources/images/delete.png        
2015-12-13 15:02:36 UTC (rev 4609)
+++ plug-ins/ViewManagerPlugin/trunk/resources/images/delete.png        
2015-12-13 17:33:07 UTC (rev 4610)

Property changes on: 
plug-ins/ViewManagerPlugin/trunk/resources/images/delete.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: plug-ins/ViewManagerPlugin/trunk/resources/images/move-vertical.png
===================================================================
(Binary files differ)

Index: plug-ins/ViewManagerPlugin/trunk/resources/images/move-vertical.png
===================================================================
--- plug-ins/ViewManagerPlugin/trunk/resources/images/move-vertical.png 
2015-12-13 15:02:36 UTC (rev 4609)
+++ plug-ins/ViewManagerPlugin/trunk/resources/images/move-vertical.png 
2015-12-13 17:33:07 UTC (rev 4610)

Property changes on: 
plug-ins/ViewManagerPlugin/trunk/resources/images/move-vertical.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: plug-ins/ViewManagerPlugin/trunk/resources/images/replace.png
===================================================================
(Binary files differ)

Index: plug-ins/ViewManagerPlugin/trunk/resources/images/replace.png
===================================================================
--- plug-ins/ViewManagerPlugin/trunk/resources/images/replace.png       
2015-12-13 15:02:36 UTC (rev 4609)
+++ plug-ins/ViewManagerPlugin/trunk/resources/images/replace.png       
2015-12-13 17:33:07 UTC (rev 4610)

Property changes on: 
plug-ins/ViewManagerPlugin/trunk/resources/images/replace.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: 
plug-ins/ViewManagerPlugin/trunk/resources/view_manager/language/jump.properties
===================================================================
--- 
plug-ins/ViewManagerPlugin/trunk/resources/view_manager/language/jump.properties
    2015-12-13 15:02:36 UTC (rev 4609)
+++ 
plug-ins/ViewManagerPlugin/trunk/resources/view_manager/language/jump.properties
    2015-12-13 17:33:07 UTC (rev 4610)
@@ -18,9 +18,13 @@
 
 ViewSetPanel.apply = Apply
 ViewSetPanel.delete = Delete
+ViewSetPanel.replace = Replace
+ViewSetPanel.move = Move
 ViewSetPanel.move-to-top = Move to top
 ViewSetPanel.move-up = Move up
 ViewSetPanel.move-down = Move down
 ViewSetPanel.move-to-bottom = Move to bottom
 ViewSetPanel.replace-by-current-view = Replace by current view
 ViewSetPanel.replace-by-selected-layers = Replace by selected layers
+
+

Modified: 
plug-ins/ViewManagerPlugin/trunk/resources/view_manager/language/jump_fr.properties
===================================================================
--- 
plug-ins/ViewManagerPlugin/trunk/resources/view_manager/language/jump_fr.properties
 2015-12-13 15:02:36 UTC (rev 4609)
+++ 
plug-ins/ViewManagerPlugin/trunk/resources/view_manager/language/jump_fr.properties
 2015-12-13 17:33:07 UTC (rev 4610)
@@ -18,6 +18,8 @@
 
 ViewSetPanel.apply = Appliquer
 ViewSetPanel.delete = Supprimer
+ViewSetPanel.replace = Remplacer
+ViewSetPanel.move = D\xE9placer
 ViewSetPanel.move-to-top = D\xE9placer tout en haut
 ViewSetPanel.move-up = D\xE9placer vers le haut
 ViewSetPanel.move-down = D\xE9pacer vers le bas

Modified: 
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/View.java
===================================================================
--- plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/View.java 
2015-12-13 15:02:36 UTC (rev 4609)
+++ plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/View.java 
2015-12-13 17:33:07 UTC (rev 4610)
@@ -33,20 +33,17 @@
     public View(){}
 
     public View(PlugInContext context, boolean selectedOnly) {
-        System.out.println("new View");
         LayerManager layerManager = context.getLayerManager();
         List<Layerable> layerables = 
layerManager.getLayerables(Layerable.class);
         name = context.getTask().getName();
         for (Layerable layerable : layerables) {
-            System.out.println("    layerable " + layerable);
+            //System.out.println("    layerable " + layerable);
             if ((!selectedOnly) || (selectedOnly && 
context.getSelectedLayerables().contains(layerable))) {
-                System.out.println("    styledLayer");
                 StyledLayer styledLayer = new StyledLayer();
                 styledLayer.layer = layerable.getName();
                 styledLayer.visible = layerable.isVisible();
-                System.out.println("    styledLayer : " + styledLayer);
+                //System.out.println("    styledLayer : " + styledLayer);
                 if (layerable.isScaleDependentRenderingEnabled()) {
-                    System.out.println("    isScaleDependentRenderingEnabled");
                     PScale scale = new PScale();
                     scale.scaleDependent = true;
                     scale.minScale = layerable.getMinScale();
@@ -54,14 +51,12 @@
                     styledLayer.scale = scale;
                 }
                 if (layerable instanceof Layer) {
-                    System.out.println("layerable instanceof Layer");
                     styledLayer.selectable = ((Layer)layerable).isSelectable();
                     styledLayer.editable = ((Layer)layerable).isEditable();
                     
styledLayer.setBasicStyle(((Layer)layerable).getBasicStyle());
                     styledLayer.setVertexStyle(((Layer) 
layerable).getBasicStyle(), ((Layer) layerable).getVertexStyle());
                     
styledLayer.setLabelStyle(((Layer)layerable).getLabelStyle());
                     
styledLayer.setColorThemingStyle((ColorThemingStyle)((Layer) 
layerable).getStyle(ColorThemingStyle.class));
-                    System.out.println("end layerable instanceof Layer");
                 }
                 addStyledLayer(styledLayer);
             }

Modified: 
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/ViewManagerPlugIn.java
===================================================================
--- 
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/ViewManagerPlugIn.java
    2015-12-13 15:02:36 UTC (rev 4609)
+++ 
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/ViewManagerPlugIn.java
    2015-12-13 17:33:07 UTC (rev 4610)
@@ -20,11 +20,7 @@
 import java.awt.event.ActionListener;
 import java.awt.event.KeyEvent;
 import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FilenameFilter;
 import java.io.IOException;
-import java.util.*;
-import java.util.List;
 
 /**
  * A plugin to apply a "view" to the project (specific styles on defined 
layers)
@@ -34,7 +30,7 @@
     static Logger LOG = Logger.getLogger(ViewManagerPlugIn.class);
     I18N I18N_ = I18N.getInstance("view_manager");
 
-    final JLabel viewSetNameLabel = new JLabel();
+    final JLabel viewSetNameLabel = new JLabel("", SwingConstants.LEFT);
 
     File viewDir;
     ViewSetPanel viewSetPanel;
@@ -138,60 +134,80 @@
         saveViewSetAsButton.addActionListener(this);
         toolBar.add(saveViewSetAsButton);
 
-        dialog.add(toolBar, BorderLayout.PAGE_START);
+        //dialog.add(toolBar, BorderLayout.PAGE_START);
         dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
         dialog.add(toolBar, BorderLayout.NORTH);
 
-        JPanel mainPanel = new JPanel();
-        mainPanel.setLayout(new GridBagLayout());
+        // Main panel
+        JPanel mainPanel = new JPanel(new GridBagLayout());
         dialog.add(mainPanel, BorderLayout.CENTER);
         final GridBagConstraints constraints = new GridBagConstraints();
 
+        constraints.gridy = 0;
         constraints.gridx = 0;
-        constraints.gridy = 0;
-        constraints.gridwidth = 2;
-        constraints.fill = GridBagConstraints.HORIZONTAL;
+        constraints.weightx = 1.0;
         constraints.anchor = GridBagConstraints.WEST;
         constraints.insets = new Insets(2,2,2,2);
 
-        JPanel viewSetNamePanel = new JPanel(new FlowLayout());
-        
viewSetNamePanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
-        viewSetNamePanel.add(new 
JLabel(I18N_.getText("view_manager","ViewManagerPlugIn.ViewSetName") + ":"));
+        constraints.gridwidth = 2;
+        constraints.fill = GridBagConstraints.HORIZONTAL;
+        mainPanel.add(new JSeparator(), constraints);
+        constraints.fill = GridBagConstraints.NONE;
+
+        constraints.gridy++;
+        constraints.gridwidth = 1;
+        constraints.weightx = 0.0;
+        mainPanel.add(new 
JLabel(I18N_.getText("view_manager","ViewManagerPlugIn.ViewSetName") + ":"), 
constraints);
+        constraints.gridx++;
+        constraints.weightx = 1.0;
         viewSetNameLabel.setText(createNewViewSetName());
         viewSetNameLabel.setForeground(Color.RED);
-        viewSetNamePanel.add(viewSetNameLabel);
-        mainPanel.add(viewSetNamePanel, constraints);
+        mainPanel.add(viewSetNameLabel, constraints);
 
+        constraints.gridy++;
         constraints.gridx = 0;
+        constraints.weightx = 1.0;
+        constraints.gridwidth = 2;
+        constraints.fill = GridBagConstraints.HORIZONTAL;
+        mainPanel.add(new JSeparator(), constraints);
+        constraints.fill = GridBagConstraints.NONE;
+
         constraints.gridy++;
+        constraints.gridx = 0;
         constraints.gridwidth = 1;
+        constraints.weightx = 0.0;
         mainPanel.add(new 
JLabel(I18N_.getText("view_manager","ViewManagerPlugIn.add-view-from-project")),
 constraints);
         constraints.gridx++;
+        constraints.weightx = 0.0;
         JButton jbAddFromProject = new 
JButton(I18N_.getText("view_manager","ViewManagerPlugIn.add"));
         jbAddFromProject.addActionListener(this);
         jbAddFromProject.setActionCommand("addFromProject");
         mainPanel.add(jbAddFromProject, constraints);
 
+        constraints.gridy++;
         constraints.gridx = 0;
-        constraints.gridy++;
+        constraints.weightx = 0.0;
         mainPanel.add(new 
JLabel(I18N_.getText("view_manager","ViewManagerPlugIn.add-view-from-selected-layers")),
 constraints);
         constraints.gridx++;
+        constraints.weightx = 0.0;
         JButton jbAddFromSelectedLayers = new 
JButton(I18N_.getText("view_manager","ViewManagerPlugIn.add"));
         jbAddFromSelectedLayers.addActionListener(this);
         jbAddFromSelectedLayers.setActionCommand("addFromSelectedLayers");
         mainPanel.add(jbAddFromSelectedLayers, constraints);
 
+        constraints.gridy++;
         constraints.gridx = 0;
-        constraints.gridy++;
         constraints.gridwidth = 2;
+        constraints.fill = GridBagConstraints.HORIZONTAL;
         mainPanel.add(new JSeparator(), constraints);
+        constraints.fill = GridBagConstraints.NONE;
 
+        constraints.gridy++;
         constraints.gridx = 0;
-        constraints.gridy++;
         constraints.gridwidth = 2;
+        constraints.weightx = 1.0;
         constraints.fill = GridBagConstraints.HORIZONTAL;
         viewSetPanel = new ViewSetPanel(context, currentViewSet);
-        //addNewViewSet();
         mainPanel.add(viewSetPanel, constraints);
 
         return dialog;
@@ -245,6 +261,7 @@
             String newViewSetName = createNewViewSetName();
             viewSetNameLabel.setText(newViewSetName);
             viewSetNameLabel.setForeground(Color.RED);
+            viewSetNameLabel.setHorizontalAlignment(SwingConstants.LEFT);
             currentViewSet = new ViewSet();
             currentViewSet.setName(newViewSetName);
             viewSetPanel.reset(context, currentViewSet);
@@ -356,12 +373,12 @@
 
     public void addFromProject(boolean selectedLayersOnly) {
         try {
-            System.out.println("Create view");
+            //System.out.println("Create view");
             View view = new View(context, selectedLayersOnly);
             if (view.name.equals(context.getTask().getName())) {
                 view.name = context.getTask().getName() + " (" + 
currentViewSet.views.size() + ")";
             }
-            System.out.println("Add project's view to ViewSet");
+            //System.out.println("Add project's view to ViewSet");
             currentViewSet.addView(view);
             viewSetNameLabel.setForeground(Color.RED);
             dialog.repaint();

Modified: 
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/ViewSet.java
===================================================================
--- 
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/ViewSet.java  
    2015-12-13 15:02:36 UTC (rev 4609)
+++ 
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/ViewSet.java  
    2015-12-13 17:33:07 UTC (rev 4610)
@@ -33,7 +33,6 @@
     }
 
     public void addView(View view) {
-        System.out.println("addView");
         views.add(view);
         fireAddView(view);
     }

Modified: 
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/ViewSetPanel.java
===================================================================
--- 
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/ViewSetPanel.java
 2015-12-13 15:02:36 UTC (rev 4609)
+++ 
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/ViewSetPanel.java
 2015-12-13 17:33:07 UTC (rev 4610)
@@ -10,6 +10,8 @@
 import java.awt.*;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
 
 /**
  * Created by UMichael on 14/06/2015.
@@ -24,14 +26,11 @@
     public ViewSetPanel(final PlugInContext context, final ViewSet viewSet) {
         super(new GridBagLayout());
         this.context = context;
-        setBorder(BorderFactory.createLineBorder(Color.black));
-        initToolBar();
         if (viewSet != null) {
             init(context, viewSet);
             viewSet.addListener(new ViewSet.Listener() {
                 public void actionPerformed(ViewSet viewSet, int mod, View 
view) {
                     removeAll();
-                    initToolBar();
                     init(context, viewSet);
                     Window window = 
SwingUtilities.getWindowAncestor(ViewSetPanel.this);
                     if (window != null) window.pack();
@@ -45,7 +44,6 @@
         viewSet.addListener(new ViewSet.Listener(){
             public void actionPerformed(ViewSet viewSet, int mod, View view) {
                 removeAll();
-                initToolBar();
                 init(context, viewSet);
                 Window window = 
SwingUtilities.getWindowAncestor(ViewSetPanel.this);
                 if (window != null) window.pack();
@@ -53,21 +51,16 @@
         });
     }
 
-    private void initToolBar() {
 
-    }
-
     private void init(PlugInContext context, ViewSet viewSet) {
         this.viewSet = viewSet;
         GridBagConstraints constraints = new GridBagConstraints();
-        constraints.gridx = 0;
-        constraints.gridy = 0;
-        constraints.anchor = GridBagConstraints.CENTER;
+        constraints.weightx = 1.0;
         constraints.insets = new Insets(2,2,2,2);
+        constraints.fill = GridBagConstraints.HORIZONTAL;
         if (viewSet != null) {
             constraints.gridy = viewSet.views.size();
             for (View view : viewSet.views) {
-                constraints.gridx = 0;
                 constraints.gridy--;
                 add(new ViewPanel(context, view), constraints);
             }
@@ -76,59 +69,100 @@
 
     class ViewPanel extends JPanel implements ActionListener {
 
-        private JMenuItem deleteMenuItem = new 
JMenuItem(I18N_.getText("view_manager","ViewSetPanel.delete"));
-        private JMenuItem topMenuItem = new 
JMenuItem(I18N_.getText("view_manager","ViewSetPanel.move-to-top"));
-        private JMenuItem upMenuItem = new 
JMenuItem(I18N_.getText("view_manager","ViewSetPanel.move-up"));
-        private JMenuItem downMenuItem = new 
JMenuItem(I18N_.getText("view_manager","ViewSetPanel.move-down"));
-        private JMenuItem bottomMenuItem = new 
JMenuItem(I18N_.getText("view_manager","ViewSetPanel.move-to-bottom"));
+        ImageIcon deleteIcon  = new 
ImageIcon(ViewSetPanel.class.getClassLoader().getResource("/images/delete.png"));
+        ImageIcon replaceIcon = new 
ImageIcon(ViewSetPanel.class.getClassLoader().getResource("/images/replace.png"));
+        ImageIcon moveIcon    = new 
ImageIcon(ViewSetPanel.class.getClassLoader().getResource("/images/move-vertical.png"));
+        ImageIcon topIcon     = new 
ImageIcon(ViewSetPanel.class.getClassLoader().getResource("/images/arrow-top.png"));
+        ImageIcon upIcon      = new 
ImageIcon(ViewSetPanel.class.getClassLoader().getResource("/images/arrow-up.png"));
+        ImageIcon downIcon    = new 
ImageIcon(ViewSetPanel.class.getClassLoader().getResource("/images/arrow-down.png"));
+        ImageIcon bottomIcon  = new 
ImageIcon(ViewSetPanel.class.getClassLoader().getResource("/images/arrow-bottom.png"));
+
         private JMenuItem replaceByCurrentViewItem = new 
JMenuItem(I18N_.getText("view_manager","ViewSetPanel.replace-by-current-view"));
         private JMenuItem replaceBySelectedLayerItem = new 
JMenuItem(I18N_.getText("view_manager","ViewSetPanel.replace-by-selected-layers"));
-        private JPopupMenu popupMenu = new JPopupMenu();
 
+        private JMenuItem topMenuItem = new 
JMenuItem(I18N_.getText("view_manager","ViewSetPanel.move-to-top"), topIcon);
+        private JMenuItem upMenuItem = new 
JMenuItem(I18N_.getText("view_manager","ViewSetPanel.move-up"), upIcon);
+        private JMenuItem downMenuItem = new 
JMenuItem(I18N_.getText("view_manager","ViewSetPanel.move-down"), downIcon);
+        private JMenuItem bottomMenuItem = new 
JMenuItem(I18N_.getText("view_manager","ViewSetPanel.move-to-bottom"), 
bottomIcon);
+
+        private JPopupMenu replacePopupMenu = new JPopupMenu();
+        private JPopupMenu movePopupMenu = new JPopupMenu();
+
+
+
         final private PlugInContext context;
         final private View view;
         final private JTextField viewTextField = new JTextField(24);
-        final private JButton apply = new 
JButton(I18N_.getText("view_manager","ViewSetPanel.apply"));
+        final private JButton applyButton      = new 
JButton(I18N_.getText("view_manager","ViewSetPanel.apply"));
+        final private JButton deleteButton     = new JButton(deleteIcon);
+        final private JButton replaceButton    = new JButton(replaceIcon);
+        final private JButton moveButton       = new JButton(moveIcon);
 
+
+
         public ViewPanel(PlugInContext context, View view) {
             super(new GridBagLayout());
             this.context = context;
             this.view = view;
             init();
 
-            popupMenu.add(deleteMenuItem);
-            deleteMenuItem.addActionListener(this);
-            deleteMenuItem.setActionCommand("delete");
+            applyButton.addActionListener(this);
+            applyButton.setActionCommand("apply");
+            applyButton.setPreferredSize(new 
Dimension(applyButton.getPreferredSize().width, 22));
 
-            popupMenu.add(topMenuItem);
+            deleteButton.addActionListener(this);
+            
deleteButton.setToolTipText(I18N_.getText("view_manager","ViewSetPanel.delete"));
+            deleteButton.setActionCommand("delete");
+            deleteButton.setPreferredSize(new Dimension(22,22));
+
+            replacePopupMenu.add(replaceByCurrentViewItem);
+            replaceByCurrentViewItem.addActionListener(this);
+            replaceByCurrentViewItem.setActionCommand("replaceByCurrentView");
+
+            replacePopupMenu.add(replaceBySelectedLayerItem);
+            replaceBySelectedLayerItem.addActionListener(this);
+            
replaceBySelectedLayerItem.setActionCommand("replaceBySelectedLayers");
+
+            movePopupMenu.add(topMenuItem);
             topMenuItem.addActionListener(this);
             topMenuItem.setActionCommand("moveToTop");
 
-            popupMenu.add(upMenuItem);
+            movePopupMenu.add(upMenuItem);
             upMenuItem.addActionListener(this);
             upMenuItem.setActionCommand("moveUp");
 
-            popupMenu.add(downMenuItem);
+            movePopupMenu.add(downMenuItem);
             downMenuItem.addActionListener(this);
             downMenuItem.setActionCommand("moveDown");
 
-            popupMenu.add(bottomMenuItem);
+            movePopupMenu.add(bottomMenuItem);
             bottomMenuItem.addActionListener(this);
             bottomMenuItem.setActionCommand("moveToBottom");
 
-            popupMenu.add(replaceByCurrentViewItem);
-            replaceByCurrentViewItem.addActionListener(this);
-            replaceByCurrentViewItem.setActionCommand("replaceByCurrentView");
+            viewTextField.addActionListener(this);
+            viewTextField.setActionCommand("changeName");
 
-            popupMenu.add(replaceBySelectedLayerItem);
-            replaceBySelectedLayerItem.addActionListener(this);
-            
replaceBySelectedLayerItem.setActionCommand("replaceBySelectedLayers");
 
-            viewTextField.addActionListener(this);
-            viewTextField.setActionCommand("changeName");
-            apply.addActionListener(this);
-            apply.setActionCommand("apply");
-            apply.setComponentPopupMenu(popupMenu);
+            
replaceButton.setToolTipText(I18N_.getText("view_manager","ViewSetPanel.replace"));
+            replaceButton.addMouseListener(new MouseAdapter() {
+                @Override
+                public void mouseClicked(MouseEvent e) {
+                    replacePopupMenu.show(e.getComponent(), e.getX(), 
e.getY());
+                }
+            });
+            replaceButton.setPreferredSize(new Dimension(22,22));
+
+
+            
moveButton.setToolTipText(I18N_.getText("view_manager","ViewSetPanel.move"));
+            moveButton.addMouseListener(new MouseAdapter() {
+                @Override
+                public void mouseClicked(MouseEvent e) {
+                    movePopupMenu.show(e.getComponent(), e.getX(), e.getY());
+                }
+            });
+            moveButton.setPreferredSize(new Dimension(22,22));
+
+
             viewTextField.getDocument().addDocumentListener(new 
DocumentListener() {
                 @Override
                 public void insertUpdate(DocumentEvent e) {
@@ -145,18 +179,30 @@
                     changeName();
                 }
             });
+
         }
 
         public void init() {
             GridBagConstraints constraints = new GridBagConstraints();
             constraints.gridx = 0;
             constraints.gridy = 0;
-            constraints.insets = new Insets(0,2,0,2);
-            constraints.anchor = GridBagConstraints.WEST;
+            constraints.weightx = 1.0;
+            constraints.insets = new Insets(0,1,0,1);
+            constraints.fill = GridBagConstraints.HORIZONTAL;
             viewTextField.setText(view.name);
             add(viewTextField, constraints);
+
+            constraints.weightx = 0.0;
+            constraints.fill = GridBagConstraints.NONE;
+            //constraints.anchor = GridBagConstraints.EAST;
             constraints.gridx = 1;
-            add(apply, constraints);
+            add(applyButton, constraints);
+            constraints.gridx = 2;
+            add(deleteButton, constraints);
+            constraints.gridx = 3;
+            add(replaceButton, constraints);
+            constraints.gridx = 4;
+            add(moveButton, constraints);
         }
 
         @Override

Modified: 
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/style/PBasicStyle.java
===================================================================
--- 
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/style/PBasicStyle.java
    2015-12-13 15:02:36 UTC (rev 4609)
+++ 
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/style/PBasicStyle.java
    2015-12-13 17:33:07 UTC (rev 4610)
@@ -3,6 +3,8 @@
 import com.vividsolutions.jump.workbench.model.Layerable;
 import com.vividsolutions.jump.workbench.ui.renderer.style.BasicStyle;
 import com.vividsolutions.jump.workbench.ui.renderer.style.Style;
+import com.vividsolutions.jump.workbench.ui.renderer.style.VertexStyle;
+import com.vividsolutions.jump.workbench.ui.renderer.style.XBasicStyle;
 import org.apache.log4j.Logger;
 
 import javax.xml.bind.annotation.XmlAttribute;
@@ -24,6 +26,9 @@
     @XmlElement
     PBasicStyleFill fill;
 
+    @XmlElement
+    PVertexStyle vertexStyle;
+
     public PBasicStyle() {}
 
     public PBasicStyle(BasicStyle style) {
@@ -31,10 +36,13 @@
         line = new PBasicStyleLine().setLineStyle(style);
         fill = new PBasicStyleFill().setFillStyle(style);
         opacity = (float) (style).getAlpha() / 255f;
+        if (style instanceof XBasicStyle) {
+            vertexStyle = new PVertexStyle(style, 
((XBasicStyle)style).getVertexStyle());
+        }
     }
 
     public Style getStyle(Layerable layerable) {
-        BasicStyle style = new BasicStyle();
+        XBasicStyle style = new XBasicStyle();
         style.setEnabled(isEnabled());
         style.setRenderingFill(fill.enabled);
         style.setRenderingLine(line.enabled);
@@ -44,6 +52,9 @@
         style.setRenderingLinePattern(line.renderingLinePattern);
         style.setLinePattern(line.pattern);
         style.setAlpha((int) (opacity * 255));
+        if (vertexStyle != null) {
+            style.setVertexStyle((VertexStyle)vertexStyle.getStyle(layerable));
+        }
         return style;
     }
 

Modified: 
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/style/PColorThemingStyle.java
===================================================================
--- 
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/style/PColorThemingStyle.java
     2015-12-13 15:02:36 UTC (rev 4609)
+++ 
plug-ins/ViewManagerPlugin/trunk/src/org/openjump/ext/viewmanager/style/PColorThemingStyle.java
     2015-12-13 17:33:07 UTC (rev 4610)
@@ -32,18 +32,12 @@
 
     public PColorThemingStyle(ColorThemingStyle style) {
         super();
-        System.out.println("    new PColorThemingStyle");
         setEnabled(style.isEnabled());
         attribute = style.getAttributeName();
         vertexStyleEnabled = style.isVertexStyleEnabled();
         defaultStyle = new PBasicStyle(style.getDefaultStyle());
-        //Map map = style.getAttributeValueToBasicStyleMap();
-        System.out.println("    PColorThemingStyle initialization");
         for (Map.Entry entry : 
(Set<Map.Entry>)style.getAttributeValueToBasicStyleMap().entrySet()) {
             if (entry.getKey() instanceof com.vividsolutions.jump.util.Range) {
-                //System.out.println("      range : " + new RangeKey(
-                //        ((Range)entry.getKey()).getMin(),
-                //        ((Range)entry.getKey()).getMax()));
                 themes.add(new Theme(new RangeKey(
                         ((Range)entry.getKey()).getMin(),
                         ((Range)entry.getKey()).getMax()),


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

Reply via email to