Revision: 5980 http://sourceforge.net/p/jump-pilot/code/5980 Author: ma15569 Date: 2018-10-28 16:34:59 +0000 (Sun, 28 Oct 2018) Log Message: ----------- Added Enabe/Disable label plugin. Moved VertexSymbol plugins to Plugin/Style submenu
Modified Paths: -------------- plug-ins/CadPlan_VertexSymbols/trunk/language/VertexSymbolsPlugin.properties plug-ins/CadPlan_VertexSymbols/trunk/language/VertexSymbolsPlugin_it.properties plug-ins/CadPlan_VertexSymbols/trunk/src/com/cadplan/jump/VertexNoteExtension.java plug-ins/CadPlan_VertexSymbols/trunk/src/com/cadplan/jump/VertexNotePlugin.java plug-ins/CadPlan_VertexSymbols/trunk/src/com/cadplan/jump/VertexSymbolsPlugIn.java Added Paths: ----------- plug-ins/CadPlan_VertexSymbols/trunk/src/com/cadplan/jump/AddRemoveLabelsPlugIn.java Modified: plug-ins/CadPlan_VertexSymbols/trunk/language/VertexSymbolsPlugin.properties =================================================================== --- plug-ins/CadPlan_VertexSymbols/trunk/language/VertexSymbolsPlugin.properties 2018-10-25 12:26:27 UTC (rev 5979) +++ plug-ins/CadPlan_VertexSymbols/trunk/language/VertexSymbolsPlugin.properties 2018-10-28 16:34:59 UTC (rev 5980) @@ -64,4 +64,5 @@ VertexNote.Dialog.Message3=Layer containing selected feature must be editable. VertexNote.Dialog.Message4=The selected feature must be in a layer with a defined External symbol. VertexNote.Dialog.SelectSymbol=Select Symbol -VertexNote.MenuItem=Vertex notes \ No newline at end of file +VertexNote.MenuItem=Vertex notes +AddRemoveLabelsPlugIn.MenuItem= Enable / Disable labeling \ No newline at end of file Modified: plug-ins/CadPlan_VertexSymbols/trunk/language/VertexSymbolsPlugin_it.properties =================================================================== --- plug-ins/CadPlan_VertexSymbols/trunk/language/VertexSymbolsPlugin_it.properties 2018-10-25 12:26:27 UTC (rev 5979) +++ plug-ins/CadPlan_VertexSymbols/trunk/language/VertexSymbolsPlugin_it.properties 2018-10-28 16:34:59 UTC (rev 5980) @@ -12,7 +12,7 @@ VertexSymbols.Dialog.About=Info VertexSymbols.Dialog.Accept=OK VertexSymbols.Dialog.Attribute=Attributo -VertexSymbols.Dialog.Auto=Auto +VertexSymbols.Dialog.Auto=Distanza automatica VertexSymbols.Dialog.BackColor=Colore Interno VertexSymbols.Dialog.Bold=Neretto VertexSymbols.Dialog.BoldItalic=Neretto+Corsivo @@ -35,7 +35,7 @@ VertexSymbols.Dialog.Image=Immagine VertexSymbols.Dialog.Left=Sinistra VertexSymbols.Dialog.Lines=Linee -VertexSymbols.Dialog.None=Nessuno +VertexSymbols.Dialog.None=Nessuna distanza VertexSymbols.Dialog.North=Nord VertexSymbols.Dialog.NorthEast=Nord-Est VertexSymbols.Dialog.NorthWest=Nord-Ovest @@ -54,7 +54,7 @@ VertexSymbols.Dialog.South=Sud VertexSymbols.Dialog.SouthEast=Sud-Est VertexSymbols.Dialog.SouthWest=Sud-Ovest -VertexSymbols.Dialog.Value=Valore -> +VertexSymbols.Dialog.Value=Distanza dal simbolo -> VertexSymbols.Dialog.Vector=Vettore VertexSymbols.Dialog.Warning1=Errore nel campo Dimensione VertexSymbols.Dialog.Warning2=Errore nel campo Orientazione @@ -66,3 +66,4 @@ VertexSymbols.MenuItem=Simbologia vertici VertexSymbols.MenuName=Estensione VertexSymbols.Dialog.Labels=Etichette +AddRemoveLabelsPlugIn.MenuItem= Attiva / Disattiva etichette \ No newline at end of file Added: plug-ins/CadPlan_VertexSymbols/trunk/src/com/cadplan/jump/AddRemoveLabelsPlugIn.java =================================================================== --- plug-ins/CadPlan_VertexSymbols/trunk/src/com/cadplan/jump/AddRemoveLabelsPlugIn.java (rev 0) +++ plug-ins/CadPlan_VertexSymbols/trunk/src/com/cadplan/jump/AddRemoveLabelsPlugIn.java 2018-10-28 16:34:59 UTC (rev 5980) @@ -0,0 +1,93 @@ +/* + * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI + * for visualizing and manipulating spatial features with geometry and attributes. + * + * Copyright (C) 2006 Cadplan + * + * 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. + * + */ + +package com.cadplan.jump; + +import java.util.Collection; + +import javax.swing.Icon; + +import com.vividsolutions.jump.workbench.model.Layer; +import com.vividsolutions.jump.workbench.plugin.AbstractPlugIn; +import com.vividsolutions.jump.workbench.plugin.EnableCheckFactory; +import com.vividsolutions.jump.workbench.plugin.MultiEnableCheck; +import com.vividsolutions.jump.workbench.plugin.PlugInContext; +import com.vividsolutions.jump.workbench.ui.MenuNames; + +/** + * User: geoff Date: 28/04/2007 Time: 09:40:22 Copyright 2007 Geoffrey G Roy. + */ +public class AddRemoveLabelsPlugIn extends AbstractPlugIn { + private I18NPlug iPlug; + + @Override + public void initialize(PlugInContext context) throws Exception { + + final EnableCheckFactory check = new EnableCheckFactory( + context.getWorkbenchContext()); + final MultiEnableCheck mcheck = new MultiEnableCheck(); + mcheck.add(check.createAtLeastNLayersMustExistCheck(1)); + mcheck.add(check.createAtLeastNLayersMustBeEditableCheck(1)); + final String menuName = MenuNames.PLUGINS; + // final String menuItem = iPlug.get("VertexSymbols.MenuItem"); + context.getFeatureInstaller().addMainMenuPlugin(this, + new String[] { menuName, MenuNames.STYLE }, getName(), false, + getIcon(), mcheck); + + } + + public Icon getIcon() { + return null; + } + + @Override + public String getName() { + iPlug = new I18NPlug("VertexSymbols", "language.VertexSymbolsPlugin"); + return iPlug.get("AddRemoveLabelsPlugIn.MenuItem"); + } + + @Override + public boolean execute(PlugInContext context) throws Exception { + @SuppressWarnings("unchecked") + final Collection<Layer> vlayers = context.getLayerNamePanel() + .selectedNodes(Layer.class); + for (final Layer layer : vlayers) { + + if (layer.getVertexStyle().isEnabled() + && !layer.getLabelStyle().isEnabled()) { + final ExternalSymbolsType vertexStyle = (ExternalSymbolsType) layer + .getVertexStyle(); + + if (vertexStyle.getTextEnabled()) { + vertexStyle.setTextEnabled(false); + + } else { + vertexStyle.setTextEnabled(true); + + } + + } + layer.fireAppearanceChanged(); + } + return true; + } +} Property changes on: plug-ins/CadPlan_VertexSymbols/trunk/src/com/cadplan/jump/AddRemoveLabelsPlugIn.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Modified: plug-ins/CadPlan_VertexSymbols/trunk/src/com/cadplan/jump/VertexNoteExtension.java =================================================================== --- plug-ins/CadPlan_VertexSymbols/trunk/src/com/cadplan/jump/VertexNoteExtension.java 2018-10-25 12:26:27 UTC (rev 5979) +++ plug-ins/CadPlan_VertexSymbols/trunk/src/com/cadplan/jump/VertexNoteExtension.java 2018-10-28 16:34:59 UTC (rev 5980) @@ -1,5 +1,6 @@ package com.cadplan.jump; +import com.cadplan.jump.AddRemoveLabelsPlugIn; import com.vividsolutions.jump.workbench.plugin.Extension; import com.vividsolutions.jump.workbench.plugin.PlugInContext; @@ -14,5 +15,6 @@ public void configure(PlugInContext context) throws Exception { new VertexNotePlugin().initialize(context); + new AddRemoveLabelsPlugIn().initialize(context); } } Modified: plug-ins/CadPlan_VertexSymbols/trunk/src/com/cadplan/jump/VertexNotePlugin.java =================================================================== --- plug-ins/CadPlan_VertexSymbols/trunk/src/com/cadplan/jump/VertexNotePlugin.java 2018-10-25 12:26:27 UTC (rev 5979) +++ plug-ins/CadPlan_VertexSymbols/trunk/src/com/cadplan/jump/VertexNotePlugin.java 2018-10-28 16:34:59 UTC (rev 5980) @@ -34,7 +34,7 @@ final String menuName = MenuNames.PLUGINS; // iPlug.get("VertexSymbols.MenuName"); context.getFeatureInstaller().addMainMenuPlugin(this, - new String[] { menuName }, getName(), false, getIcon(), mcheck); + new String[] {menuName, MenuNames.STYLE}, getName(), false, getIcon(), mcheck); context.getWorkbenchFrame() .getToolBar() .addPlugIn(getIcon(), this, mcheck, Modified: plug-ins/CadPlan_VertexSymbols/trunk/src/com/cadplan/jump/VertexSymbolsPlugIn.java =================================================================== --- plug-ins/CadPlan_VertexSymbols/trunk/src/com/cadplan/jump/VertexSymbolsPlugIn.java 2018-10-25 12:26:27 UTC (rev 5979) +++ plug-ins/CadPlan_VertexSymbols/trunk/src/com/cadplan/jump/VertexSymbolsPlugIn.java 2018-10-28 16:34:59 UTC (rev 5980) @@ -50,7 +50,7 @@ final String menuName = MenuNames.PLUGINS; // iPlug.get("VertexSymbols.MenuName"); // final String menuItem = iPlug.get("VertexSymbols.MenuItem"); context.getFeatureInstaller().addMainMenuPlugin(this, - new String[] { menuName }, getName(), false, getIcon(), mcheck); + new String[] { menuName, MenuNames.STYLE}, getName(), false, getIcon(), mcheck); context.getWorkbenchFrame() .getToolBar() .addPlugIn(getIcon(), this, mcheck, _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel