mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-07 12:24:58 +10:00
bom tweak
anti-aliasing made as configurable item
This commit is contained in:
@@ -11,5 +11,5 @@
|
||||
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;Library&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;DIYLC&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;default/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> </sourceContainers> </sourceLookupDirector> "/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.diylc.DIYLCStarter"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="DIYLC"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms32m -Xmx128m"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms64m -Xmx256m"/>
|
||||
</launchConfiguration>
|
||||
|
||||
Binary file not shown.
+1
-1
@@ -27,7 +27,7 @@ public class BomMaker {
|
||||
Map<String, BomEntry> entryMap = new HashMap<String, BomEntry>();
|
||||
for (IDIYComponent<?> component : components) {
|
||||
String name = component.getName();
|
||||
String value = component.getValue() == null ? "" : component.getValue().toString();
|
||||
String value = component.getValue() == null ? null : component.getValue().toString();
|
||||
if ((name != null) && (value != null)) {
|
||||
String key = name + "|" + value;
|
||||
if (entryMap.containsKey(key)) {
|
||||
|
||||
+4
-4
@@ -64,7 +64,7 @@ public class Presenter implements IPlugInPort {
|
||||
private static final Logger LOG = Logger.getLogger(Presenter.class);
|
||||
|
||||
public static final VersionNumber CURRENT_VERSION = new VersionNumber(3, 0, 1);
|
||||
public static final String DEFAULTS_KEY = "default.";
|
||||
public static final String DEFAULTS_KEY_PREFIX = "default.";
|
||||
public static final String METRIC_KEY = "metric";
|
||||
|
||||
public static final int ICON_SIZE = 32;
|
||||
@@ -783,7 +783,7 @@ public class Presenter implements IPlugInPort {
|
||||
String className = component.getClass().getName();
|
||||
LOG.debug("Default property value set for " + className + ":" + propertyName);
|
||||
ConfigurationManager.getInstance().writeValue(
|
||||
DEFAULTS_KEY + className + ":" + propertyName, value);
|
||||
DEFAULTS_KEY_PREFIX + className + ":" + propertyName, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -792,7 +792,7 @@ public class Presenter implements IPlugInPort {
|
||||
LOG.info(String.format("setProjectDefaultPropertyValue(%s, %s)", propertyName, value));
|
||||
LOG.debug("Default property value set for " + Project.class.getName() + ":" + propertyName);
|
||||
ConfigurationManager.getInstance().writeValue(
|
||||
DEFAULTS_KEY + Project.class.getName() + ":" + propertyName, value);
|
||||
DEFAULTS_KEY_PREFIX + Project.class.getName() + ":" + propertyName, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1031,7 +1031,7 @@ public class Presenter implements IPlugInPort {
|
||||
// Override with default values if available.
|
||||
for (PropertyWrapper property : properties) {
|
||||
Object defaultValue = ConfigurationManager.getInstance().readObject(
|
||||
DEFAULTS_KEY + object.getClass().getName() + ":" + property.getName(), null);
|
||||
DEFAULTS_KEY_PREFIX + object.getClass().getName() + ":" + property.getName(), null);
|
||||
if (defaultValue != null) {
|
||||
property.setValue(cloner.deepClone(defaultValue));
|
||||
property.writeTo(object);
|
||||
|
||||
+7
-2
@@ -25,6 +25,8 @@ import org.diylc.core.Project;
|
||||
import org.diylc.core.VisibilityPolicy;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
import com.diyfever.gui.miscutils.ConfigurationManager;
|
||||
|
||||
/**
|
||||
* Utility that deals with painting {@link Project} on the {@link Graphics2D}
|
||||
* and keeps areas taken by each drawn component.
|
||||
@@ -34,7 +36,7 @@ import org.diylc.utils.Constants;
|
||||
public class ProjectPainter {
|
||||
|
||||
public static final int CONTROL_POINT_SIZE = 7;
|
||||
public static boolean ENABLE_ANTIALIASING = true;
|
||||
public static final String ANTIALIASING_KEY = "anti-aliasing";
|
||||
public static boolean DEBUG_COMPONENT_AREAS = false;
|
||||
|
||||
// Keeps Area object of each drawn component.
|
||||
@@ -43,6 +45,9 @@ public class ProjectPainter {
|
||||
// determine which components are invalidated when they are not in the map.
|
||||
private Map<IDIYComponent<?>, ComponentState> lastDrawnStateMap;
|
||||
|
||||
public boolean antiAliasing = ConfigurationManager.getInstance().readBoolean(
|
||||
ANTIALIASING_KEY, true);
|
||||
|
||||
public ProjectPainter() {
|
||||
super();
|
||||
componentAreaMap = new HashMap<IDIYComponent<?>, Area>();
|
||||
@@ -58,7 +63,7 @@ public class ProjectPainter {
|
||||
}
|
||||
G2DWrapper g2dWrapper = new G2DWrapper(g2d);
|
||||
|
||||
if (drawOptions.contains(DrawOption.ANTIALIASING) && ENABLE_ANTIALIASING) {
|
||||
if (drawOptions.contains(DrawOption.ANTIALIASING) && antiAliasing) {
|
||||
g2d
|
||||
.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
|
||||
RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
|
||||
+1
-5
@@ -8,17 +8,13 @@ import java.awt.Stroke;
|
||||
public class Constants {
|
||||
|
||||
public static final int PIXELS_PER_INCH = 150;//Toolkit.getDefaultToolkit().getScreenResolution();
|
||||
public static int GRIDS_PER_INCH = 8;
|
||||
// public static Size GRID_SIZE = new Size(1d / GRIDS_PER_INCH, SizeUnit.in);
|
||||
// public static final int GRID = 20;
|
||||
|
||||
public static Color CANVAS_COLOR = Color.white;
|
||||
public static Color GRID_COLOR = new Color(240, 240, 240);
|
||||
public static Color CONTROL_POINT_COLOR = Color.black;
|
||||
public static Color SELECTED_CONTROL_POINT_COLOR = Color.blue;
|
||||
public static Color CREATION_POINT_COLOR = Color.decode("#32CD32");
|
||||
|
||||
public static Font LABEL_FONT = new Font("Tahoma", Font.PLAIN, 11);
|
||||
public static Font LABEL_FONT = new Font("Tahoma", Font.PLAIN, 12);
|
||||
|
||||
public static final Stroke BASIC_STROKE = new BasicStroke();
|
||||
public static final Stroke DASHED_STROKE = new BasicStroke(1.0f, BasicStroke.CAP_BUTT,
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ public abstract class AbstractBoard extends AbstractTransparentComponent<String>
|
||||
public static Size DEFAULT_WIDTH = new Size(1.5d, SizeUnit.in);
|
||||
public static Size DEFAULT_HEIGHT = new Size(1d, SizeUnit.in);
|
||||
|
||||
protected String value;
|
||||
protected String value = "";
|
||||
protected Point[] controlPoints = new Point[] { new Point(0, 0),
|
||||
new Point(DEFAULT_WIDTH.convertToPixels(), DEFAULT_HEIGHT.convertToPixels()) };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user