📄 linestyleproperty.java
字号:
package jmathlib.core.graphics.properties;import java.awt.*;import jmathlib.core.graphics.*;public class LineStyleProperty extends RadioProperty{ public LineStyleProperty(PropertySet parent, String name, String style) { super(parent, name, new String[] {"-", ":", "--", "-.", "none"}, style); } public Stroke getStroke(float width) { String ls = getValue(); if (ls.equals(":")) return new BasicStroke(width, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 1.0f, new float[] {2.0f, 3.0f}, 0.0f); else if (ls.equals("-")) return new BasicStroke(width); else if (ls.equals("--")) return new BasicStroke(width, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 1.0f, new float[] {10.0f, 5.0f}, 0.0f); else if (ls.equals("-.")) return new BasicStroke(width, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 1.0f, new float[] {5.0f, 5.0f, 1.0f, 5.0f}, 0.0f); else return null; } public Stroke getStroke() { return getStroke(0.0f); } public void setStyle(String s) { try { set(s); } catch (PropertyException e) { } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -