Skip to content

Commit

Permalink
allows to configure fill opacity of edit geom (locationtech#313)
Browse files Browse the repository at this point in the history
* get fill opacity of edit geom from preference store

Signed-off-by: sloob <sebastian.loob@ibykus.de>
  • Loading branch information
sloob authored and fgdrf committed Dec 23, 2019
1 parent 2b23a30 commit 98509e5
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 6 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ public class Messages extends NLS {
public static String EditToolPreferences_selectedGeom;
public static String EditToolPreferences_advanced_editing_name;
public static String EditToolPreferences_vertexDiameter;
public static String EditToolPreferneces_vertexOpacity;
public static String EditToolPreferences_vertexOpacity;
public static String EditToolPreferences_fillOpacity;
public static String EditToolPreferences_grid;
public static String EditToolPreferences_all;
public static String EditToolPreferences_current;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ EditToolPreferences_description = Edit Tools general preferences

EditToolPreferences_feedbackColor = Feedback

EditToolPreferences_fillOpacity=Fill Opacity

EditToolPreferences_grid = Grid

EditToolPreferences_gridLabel = Grid Size (Degrees)
Expand All @@ -118,7 +120,7 @@ EditToolPreferences_vertexDiameter = Vertex Diameter

EditToolPreferences_vertexOutline = Vertex Outlines

EditToolPreferneces_vertexOpacity = Vertex Opacity
EditToolPreferences_vertexOpacity=Vertex Opacity

EventBehaviourCommand_name = EventBehaviour

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,14 @@ protected void createFieldEditors() {
Messages.EditToolPreferences_vertexDiameter,
getFieldEditorParent()));

IntegerFieldEditor fillOpacity = new IntegerFieldEditor(PreferenceConstants.P_FILL_OPACITY,
Messages.EditToolPreferences_fillOpacity,
getFieldEditorParent());
fillOpacity.setValidRange(0, 100);
addField(fillOpacity);

IntegerFieldEditor vertexOpacity = new IntegerFieldEditor(PreferenceConstants.P_VERTEX_OPACITY,
Messages.EditToolPreferneces_vertexOpacity,
Messages.EditToolPreferences_vertexOpacity,
getFieldEditorParent());
vertexOpacity.setValidRange(0, 100);
addField(vertexOpacity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@ public class PreferenceConstants {
*/
public static final int P_DEFAULT_DELETE_SEARCH_SCALEFACTOR = 6;

/**
* The opacity of color used to fill the geoms on the EditBlackboard.
*/
public static final String P_FILL_OPACITY = "P_FILL_OPACITY"; //$NON-NLS-1$

/**
* The opacity of color used for the vertex of the edit geoms.
*/
public static final String P_VERTEX_OPACITY = "P_VERTEX_OPACITY"; //$NON-NLS-1$

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public void initializeDefaultPreferences() {
store.setDefault(PreferenceConstants.P_DELETE_TOOL_CONFIRM, true);
store.setDefault(PreferenceConstants.P_DELETE_TOOL_SEARCH_SCALEFACTOR,
PreferenceConstants.P_DEFAULT_DELETE_SEARCH_SCALEFACTOR);
store.setDefault(PreferenceConstants.P_FILL_OPACITY, 35);
store.setDefault(PreferenceConstants.P_VERTEX_OPACITY, 35);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public Color getSelectionColor() {
*/
public Color getDrawGeomsFill() {
Color base = getSelectionColor();
return reduceTransparency(base,.35f);
return reduceTransparency(base, (float) store.getInt(PreferenceConstants.P_FILL_OPACITY) / 100);
}

/**
Expand Down

0 comments on commit 98509e5

Please sign in to comment.