add icon of Designer

This commit is contained in:
nisihara1 2017-07-16 15:56:45 +09:00
parent 16179150a9
commit fa1d957ac3
4 changed files with 176 additions and 21 deletions

View File

@ -10,10 +10,11 @@ org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=48
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
@ -21,19 +22,24 @@ org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=48
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_module_statements=16
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=48
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0
org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
@ -60,6 +66,7 @@ org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true
org.eclipse.jdt.core.formatter.comment.format_block_comments=false
org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
@ -92,6 +99,7 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=4
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
@ -281,16 +289,29 @@ org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.jdt.core.formatter.lineSplit=150
org.eclipse.jdt.core.formatter.lineSplit=120
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.tabulation.char=space
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter

View File

@ -18,6 +18,7 @@ public class ViewerItemSet {
private ViewerItem modelerItem;
private ViewerItem saveFileItem;
private ViewerItem saveAsFileItem;
private ViewerItem designerItem;
private ViewerItem screenShotItem;
private ViewerItem runItem;
private ViewerItem resultItem;
@ -28,6 +29,7 @@ public class ViewerItemSet {
this.modelerItem = new ViewerItem(SVGData.TOOL, "Modeler");
this.saveFileItem = new ViewerItem(SVGData.SAVE, "Save");
this.saveAsFileItem = new ViewerItem(SVGData.SAVE, "Save as ...");
this.designerItem = new ViewerItem(SVGData.COLORS, "Designer");
this.screenShotItem = new ViewerItem(SVGData.CAMERA, "Screen-shot");
this.runItem = new ViewerItem(SVGData.RUN, "Run");
this.resultItem = new ViewerItem(SVGData.RESULT, "Result");
@ -40,6 +42,7 @@ public class ViewerItemSet {
this.modelerItem,
this.saveFileItem,
this.saveAsFileItem,
this.designerItem,
this.screenShotItem,
this.runItem,
this.resultItem
@ -66,6 +69,10 @@ public class ViewerItemSet {
return this.saveAsFileItem;
}
public ViewerItem getDesignerItem() {
return this.designerItem;
}
public ViewerItem getScreenShotItem() {
return this.screenShotItem;
}

View File

@ -0,0 +1,50 @@
/*
* Copyright (C) 2017 Satomichi Nishihara
*
* This file is distributed under the terms of the
* GNU General Public License. See the file `LICENSE'
* in the root directory of the present distribution,
* or http://www.gnu.org/copyleft/gpl.txt .
*/
package burai.com.graphic.svg;
public interface SVGItemColors {
public static final double WIDTH = 515.924;
public static final double HEIGHT = 515.924;
public static final String[] STYLES = {
"-fx-fill: #009cbd",
"-fx-fill: #e22b2e",
"-fx-fill: #f57826",
"-fx-fill: #00b199",
"-fx-fill: #68dbef",
"-fx-fill: #fddf68",
"-fx-fill: #ffffff"
};
public static final String[] CONTENTS = {
"M154.53,333.552c0,0.32-0.024,0.64-0.024,0.96c0,72.808,42.36,135.568,103.456,164.444"
+ "c-22.972,10.86-48.584,16.96-75.604,16.96c-98.896,0-179.064-81.22-179.064-181.408c0-58.54,27.392-110.568,69.872-143.736"
+ "C76.17,250.64,107.85,302.8,154.53,333.552z",
"M512.63,334.516c0,100.188-80.168,181.408-179.064,181.408c-27.024,0-52.632-6.1-75.604-16.96"
+ "c61.096-28.88,103.456-91.636,103.456-164.444c0-3.148-0.08-6.264-0.236-9.372c42.248-32.988,69.548-84.632,69.844-142.776"
+ "C480.138,214.712,512.63,270.752,512.63,334.516z",
"M154.506,334.516c0-0.32,0.024-0.64,0.024-0.96c28.056,18.484,61.508,29.26,97.464,29.26"
+ "c41.116,0,78.964-14.076,109.192-37.672c0.164,3.104,0.24,6.232,0.24,9.372c0,72.808-42.364,135.568-103.456,164.444"
+ "C196.866,470.076,154.506,407.32,154.506,334.516z",
"M257.962,170.064c-22.972-10.86-48.584-16.96-75.604-16.96c-41.116,0-78.96,14.072-109.192,37.672"
+ "c-0.152-3.104-0.236-6.228-0.236-9.368C72.93,81.22,153.094,0,251.994,0c98.904,0,179.068,81.216,179.068,181.408"
+ "c0,0.32-0.024,0.636-0.024,0.956c-28.056-18.484-61.508-29.26-97.468-29.26C306.546,153.104,280.934,159.204,257.962,170.064z",
"M257.962,170.064c-60.832,28.752-103.068,91.088-103.432,163.492"
+ "c-46.68-30.752-78.36-82.916-81.364-142.772c30.232-23.6,68.076-37.672,109.192-37.672"
+ "C209.378,153.104,234.99,159.204,257.962,170.064z",
"M361.186,325.14c-3.456-68.8-44.756-127.444-103.224-155.08c22.972-10.86,48.584-16.96,75.604-16.96"
+ "c35.96,0,69.416,10.776,97.46,29.26C430.73,240.508,403.43,292.152,361.186,325.14z",
"M154.53,333.552c0.364-72.4,42.6-134.736,103.432-163.488c58.464,27.636,99.76,86.28,103.224,155.08"
+ "c-30.228,23.596-68.076,37.672-109.192,37.672C216.038,362.816,182.574,352.04,154.53,333.552z"
};
}

View File

@ -34,6 +34,7 @@ public final class SVGLibrary {
CENTER(SVGItemCenter.WIDTH, SVGItemCenter.HEIGHT, SVGItemCenter.CONTENT),
CHECK(SVGItemCheck.WIDTH, SVGItemCheck.HEIGHT, SVGItemCheck.CONTENT),
CLOSE(SVGItemClose.WIDTH, SVGItemClose.HEIGHT, SVGItemClose.CONTENT),
COLORS(SVGItemColors.WIDTH, SVGItemColors.HEIGHT, SVGItemColors.STYLES, SVGItemColors.CONTENTS),
CONTROL(SVGItemControl.WIDTH, SVGItemControl.HEIGHT, SVGItemControl.CONTENT),
CROSS(SVGItemPlus.WIDTH, SVGItemPlus.HEIGHT, 45.0, SVGItemPlus.CONTENT),
CRYSTAL(SVGItemCrystal.WIDTH, SVGItemCrystal.HEIGHT, SVGItemCrystal.CONTENT),
@ -87,6 +88,9 @@ public final class SVGLibrary {
private double angle;
private String content;
private String[] styles;
private String[] contents;
private SVGData(double width, double height, String content) {
this(width, height, 0.0, content);
}
@ -108,7 +112,41 @@ public final class SVGLibrary {
this.height = height;
this.angle = angle;
this.content = content;
this.styles = null;
this.contents = null;
}
private SVGData(double width, double height, String[] styles, String[] contents) {
this(width, height, 0.0, styles, contents);
}
private SVGData(double width, double height, double angle, String[] styles, String[] contents) {
if (width <= 0.0) {
throw new IllegalArgumentException("width is not positive.");
}
if (height <= 0.0) {
throw new IllegalArgumentException("height is not positive.");
}
if (styles == null || styles.length < 1) {
throw new IllegalArgumentException("styles is empty.");
}
if (contents == null || contents.length < 1) {
throw new IllegalArgumentException("contents is empty.");
}
this.width = width;
this.height = height;
this.angle = angle;
this.content = null;
this.styles = styles;
this.contents = contents;
}
}
public static Node getGraphic(SVGData svgData, double size) {
@ -128,24 +166,63 @@ public final class SVGLibrary {
throw new IllegalArgumentException("size is not positive.");
}
SVGPath svgPath = new SVGPath();
if (styleClass != null && (!styleClass.isEmpty())) {
svgPath.getStyleClass().add(styleClass);
}
if (style != null && (!style.isEmpty())) {
svgPath.setStyle(style);
}
svgPath.setContent(svgData.content);
svgPath.getTransforms().add(new Scale(size / svgData.width, size / svgData.height, 0.0, 0.0));
if (svgData.angle != 0.0) {
svgPath.getTransforms().add(new Rotate(svgData.angle, 0.5 * svgData.width, 0.5 * svgData.height));
}
Pane pane = new Pane(svgPath);
Pane pane = new Pane();
pane.setPrefSize(size, size);
if (svgData.content != null) {
SVGPath svgPath = new SVGPath();
if (styleClass != null && (!styleClass.isEmpty())) {
svgPath.getStyleClass().add(styleClass);
}
if (style != null && (!style.isEmpty())) {
svgPath.setStyle(style);
}
svgPath.setContent(svgData.content);
svgPath.getTransforms().add(new Scale(size / svgData.width, size / svgData.height, 0.0, 0.0));
if (svgData.angle != 0.0) {
svgPath.getTransforms().add(new Rotate(svgData.angle, 0.5 * svgData.width, 0.5 * svgData.height));
}
pane.getChildren().add(svgPath);
} else if (svgData.contents != null) {
for (int i = 0; i < svgData.contents.length; i++) {
String style0 = svgData.styles[i];
String content0 = svgData.contents[i];
if (content0 == null || content0.isEmpty()) {
continue;
}
SVGPath svgPath = new SVGPath();
if (styleClass != null && (!styleClass.isEmpty())) {
svgPath.getStyleClass().add(styleClass);
}
if (style0 != null && (!style0.isEmpty())) {
svgPath.setStyle(style0);
} else if (style != null && (!style.isEmpty())) {
svgPath.setStyle(style);
}
svgPath.setContent(content0);
svgPath.getTransforms().add(new Scale(size / svgData.width, size / svgData.height, 0.0, 0.0));
if (svgData.angle != 0.0) {
svgPath.getTransforms().add(new Rotate(svgData.angle, 0.5 * svgData.width, 0.5 * svgData.height));
}
pane.getChildren().add(svgPath);
}
}
Group group = new Group(pane);
return group;
}