[Schmitzm-commits] r54 - trunk/src/schmitzm/geotools/gui
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Apr 17 16:10:10 CEST 2009
Author: alfonx
Date: 2009-04-17 16:10:10 +0200 (Fri, 17 Apr 2009)
New Revision: 54
Modified:
trunk/src/schmitzm/geotools/gui/SelectableFeatureTablePane.java
Log:
Modified: trunk/src/schmitzm/geotools/gui/SelectableFeatureTablePane.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/SelectableFeatureTablePane.java 2009-04-17 14:04:22 UTC (rev 53)
+++ trunk/src/schmitzm/geotools/gui/SelectableFeatureTablePane.java 2009-04-17 14:10:10 UTC (rev 54)
@@ -1,9 +1,20 @@
package schmitzm.geotools.gui;
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.net.URL;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JToolBar;
import org.geotools.feature.FeatureCollection;
+
/**
* Extends the {@link FeatureTablePane} with buttons and functionality to select
* lines
@@ -14,30 +25,108 @@
public class SelectableFeatureTablePane extends FeatureTablePane {
public static final ImageIcon ICON_SELECTION_INVERT = new ImageIcon(
- JEditorPane.class
- .getResource("resource/icons/mActionInvertSelection.png.png"));
+ SelectableFeatureTablePane.class
+ .getResource("resource/icons/mActionInvertSelection.png"));
public static final ImageIcon ICON_SELECTED_TO_TOP = new ImageIcon(
- JEditorPane.class
- .getResource("resource/icons/mActionInvertSelectedToTop.png"));
+ SelectableFeatureTablePane.class
+ .getResource("resource/icons/mActionSelectedToTop.png") );
public static final ImageIcon ICON_UNSELECT = new ImageIcon(
- JEditorPane.class
+ SelectableFeatureTablePane.class
.getResource("resource/icons/mActionUnselectAttributes.png"));
- public static final ImageIcon ICON_ZOMM_To_SELECTED = new ImageIcon(
- JEditorPane.class
+ public static final ImageIcon ICON_ZOMM_TO_SELECTED = new ImageIcon(
+ SelectableFeatureTablePane.class
.getResource("resource/icons/mActionZoomToSelected.png"));
public SelectableFeatureTablePane(FeatureCollectionTableModel model,
boolean geomPreview) {
- super(model, geomPreview);
+ super(model, null, null, geomPreview);
+
+ JPanel newPanelArroundTable = new JPanel( new BorderLayout() );
+
+
+ if (splitPane != null) {
+ newPanelArroundTable.add(splitPane.getContainer(1), BorderLayout.CENTER);
+ splitPane.setContainer(1, newPanelArroundTable);
+ } else {
+ newPanelArroundTable.add(getComponent(0), BorderLayout.CENTER);
+ removeAll();
+ add(newPanelArroundTable);
+ }
+
+ newPanelArroundTable.add(getToolBar(), BorderLayout.NORTH);
+ newPanelArroundTable.add(getSearchBar(), BorderLayout.NORTH);
}
+
- @Override
- protected void initGUI(boolean geomPreview) {
- super.initGUI(geomPreview);
-
+ private Component getSearchBar() {
+ return new JLabel("Search here one day");
}
+
+ /**
+ * Creates
+ */
+ protected JToolBar getToolBar() {
+ JToolBar toolBar = new JToolBar();
+
+ /**
+ * Add an Action to clear the selection
+ */
+ AbstractAction clearSelectionAction = new AbstractAction("", ICON_UNSELECT){
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ }
+
+ };
+ clearSelectionAction.putValue(Action.SHORT_DESCRIPTION, "tt");
+ toolBar.add(clearSelectionAction);
+
+
+ /**
+ * Add an Action to move the selected items
+ */
+ AbstractAction selectionToTopAction = new AbstractAction("", ICON_SELECTED_TO_TOP){
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ }
+
+ };
+ selectionToTopAction.putValue(Action.SHORT_DESCRIPTION, "tt");
+ toolBar.add(selectionToTopAction);
+
+ /**
+ * Add an Action to move the selected items
+ */
+ AbstractAction selectionInverseAction = new AbstractAction("", ICON_SELECTION_INVERT){
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ }
+
+ };
+ selectionInverseAction.putValue(Action.SHORT_DESCRIPTION, "tt");
+ toolBar.add(selectionInverseAction);
+
+
+ /**
+ * Add an Action to move the selected items
+ */
+ AbstractAction zoomToselectionAction = new AbstractAction("", ICON_ZOMM_TO_SELECTED){
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ }
+
+ };
+ zoomToselectionAction.putValue(Action.SHORT_DESCRIPTION, "tt");
+ toolBar.add(zoomToselectionAction);
+
+ return toolBar;
+ }
+
+
/**
* Zeigt die aktuell in der Tabelle selektierten Features im Preview-Bereich
* an.
More information about the Schmitzm-commits
mailing list