Browse Source

- Removed old paint code

- Fixed some minor UI bugs
Stan Hebben 6 years ago
parent
commit
9703d03f24
56 changed files with 104 additions and 581 deletions
  1. 0
    67
      DrawableGui/src/main/java/org/openzen/drawablegui/DCanvas.java
  2. 0
    2
      DrawableGui/src/main/java/org/openzen/drawablegui/DColorableIcon.java
  3. 0
    6
      DrawableGui/src/main/java/org/openzen/drawablegui/DCompositeIcon.java
  4. 0
    2
      DrawableGui/src/main/java/org/openzen/drawablegui/DDrawable.java
  5. 0
    2
      DrawableGui/src/main/java/org/openzen/drawablegui/border/DCustomWindowBorder.java
  6. 0
    1
      DrawableGui/src/main/java/org/openzen/drawablegui/border/DPaddedBorder.java
  7. 0
    7
      DrawableGui/src/main/java/org/openzen/drawablegui/draw/DDrawSurface.java
  8. 0
    2
      DrawableGui/src/main/java/org/openzen/drawablegui/draw/DSubSurface.java
  9. 0
    1
      DrawableGui/src/main/java/org/openzen/drawablegui/form/DForm.java
  10. 0
    1
      DrawableGui/src/main/java/org/openzen/drawablegui/layout/DLinearLayout.java
  11. 0
    2
      DrawableGui/src/main/java/org/openzen/drawablegui/layout/DSideLayout.java
  12. 0
    3
      DrawableGui/src/main/java/org/openzen/drawablegui/scroll/DScrollBar.java
  13. 0
    1
      DrawableGui/src/main/java/org/openzen/drawablegui/scroll/DScrollPane.java
  14. 0
    212
      DrawableGui/src/main/java/org/openzen/drawablegui/swing/SwingCanvas.java
  15. 59
    5
      DrawableGui/src/main/java/org/openzen/drawablegui/swing/SwingDrawSurface.java
  16. 1
    2
      DrawableGui/src/main/java/org/openzen/drawablegui/swing/SwingDrawnText.java
  17. 2
    3
      DrawableGui/src/main/java/org/openzen/drawablegui/swing/SwingFilledPath.java
  18. 1
    1
      DrawableGui/src/main/java/org/openzen/drawablegui/swing/SwingGraphicsContext.java
  19. 5
    7
      DrawableGui/src/main/java/org/openzen/drawablegui/swing/SwingShadowedPath.java
  20. 2
    2
      DrawableGui/src/main/java/org/openzen/drawablegui/swing/SwingStrokedPath.java
  21. 0
    37
      DrawableGui/src/main/java/org/openzen/drawablegui/swing/SwingSubSurface.java
  22. 0
    6
      DrawableGui/src/main/java/org/openzen/drawablegui/tree/CollapsedArrow.java
  23. 0
    6
      DrawableGui/src/main/java/org/openzen/drawablegui/tree/ColoredCollapsedArrow.java
  24. 13
    12
      DrawableGui/src/main/java/org/openzen/drawablegui/tree/DTreeView.java
  25. 0
    6
      DrawableGui/src/main/java/org/openzen/drawablegui/tree/ExpandedArrow.java
  26. 0
    6
      DrawableGui/src/main/java/org/openzen/drawablegui/tree/ExpandedColoredArrow.java
  27. 2
    9
      DrawableGuiIconConverter/src/main/java/org/openzen/drawablegui/iconconverter/Main.java
  28. 0
    7
      IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/AddBoxIcon.java
  29. 0
    6
      IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/BuildIcon.java
  30. 0
    6
      IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ChevronRight.java
  31. 0
    6
      IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/CloseIcon.java
  32. 0
    6
      IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/CodeIcon.java
  33. 0
    6
      IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ColoredIcon.java
  34. 0
    6
      IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/FolderIcon.java
  35. 0
    6
      IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/LibraryIcon.java
  36. 0
    6
      IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ModuleIcon.java
  37. 0
    6
      IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/PlayIcon.java
  38. 0
    6
      IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ProjectIcon.java
  39. 0
    6
      IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/SaveIcon.java
  40. 0
    6
      IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ScalableCloseIcon.java
  41. 0
    6
      IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ScalableMaximizeIcon.java
  42. 0
    6
      IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ScalableMinimizeIcon.java
  43. 0
    7
      IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/SettingsIcon.java
  44. 0
    6
      IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ShadedCodeIcon.java
  45. 0
    6
      IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ShadedProjectIcon.java
  46. 1
    7
      IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ShadedSaveIcon.java
  47. 0
    1
      IDE/src/main/java/org/openzen/zenscript/ide/ui/view/IconButtonControl.java
  48. 0
    1
      IDE/src/main/java/org/openzen/zenscript/ide/ui/view/StatusBarView.java
  49. 11
    16
      IDE/src/main/java/org/openzen/zenscript/ide/ui/view/TabbedView.java
  50. 0
    1
      IDE/src/main/java/org/openzen/zenscript/ide/ui/view/TabbedViewTab.java
  51. 6
    1
      IDE/src/main/java/org/openzen/zenscript/ide/ui/view/WindowView.java
  52. 0
    1
      IDE/src/main/java/org/openzen/zenscript/ide/ui/view/aspectbar/AspectBarSelectorButton.java
  53. 0
    6
      IDE/src/main/java/org/openzen/zenscript/ide/ui/view/aspectbar/AspectBarView.java
  54. 0
    1
      IDE/src/main/java/org/openzen/zenscript/ide/ui/view/aspectbar/WindowActionButton.java
  55. 1
    24
      IDE/src/main/java/org/openzen/zenscript/ide/ui/view/editor/SourceEditor.java
  56. 0
    1
      IDE/src/main/java/org/openzen/zenscript/ide/ui/view/output/OutputView.java

+ 0
- 67
DrawableGui/src/main/java/org/openzen/drawablegui/DCanvas.java View File

@@ -1,67 +0,0 @@
1
-/*
2
- * To change this license header, choose License Headers in Project Properties.
3
- * To change this template file, choose Tools | Templates
4
- * and open the template in the editor.
5
- */
6
-package org.openzen.drawablegui;
7
-
8
-import org.openzen.drawablegui.style.DShadow;
9
-
10
-/**
11
- *
12
- * @author Hoofdgebruiker
13
- */
14
-public interface DCanvas {
15
-	void pushBounds(DIRectangle bounds);
16
-	
17
-	void popBounds();
18
-	
19
-	void pushOffset(int x, int y);
20
-	
21
-	void popOffset();
22
-	
23
-	DIRectangle getBounds();
24
-	
25
-	DUIContext getContext();
26
-	
27
-	void drawText(DFont font, int color, float x, float y, String text);
28
-	
29
-	/**
30
-	 * Strokes a given path.
31
-	 * 
32
-	 * @param path path to be stroked
33
-	 * @param transform path transform
34
-	 * @param color path color
35
-	 * @param lineWidth path line width
36
-	 */
37
-	void strokePath(DPath path, DTransform2D transform, int color, float lineWidth);
38
-	
39
-	/**
40
-	 * Fills a given path.
41
-	 * 
42
-	 * @param path path to be filled
43
-	 * @param transform 
44
-	 * @param color
45
-	 */
46
-	void fillPath(DPath path, DTransform2D transform, int color);
47
-	
48
-	/**
49
-	 * Draws the shadow for a given path.
50
-	 * 
51
-	 * @param path
52
-	 * @param transform
53
-	 * @param shadow
54
-	 */
55
-	void shadowPath(DPath path, DTransform2D transform, int color, DShadow shadow);
56
-	
57
-	/**
58
-	 * Fills a rectangle.
59
-	 * 
60
-	 * @param x
61
-	 * @param y
62
-	 * @param width
63
-	 * @param height
64
-	 * @param color 
65
-	 */
66
-	void fillRectangle(int x, int y, int width, int height, int color);
67
-}

+ 0
- 2
DrawableGui/src/main/java/org/openzen/drawablegui/DColorableIcon.java View File

@@ -12,8 +12,6 @@ import org.openzen.drawablegui.draw.DDrawTarget;
12 12
  * @author Hoofdgebruiker
13 13
  */
14 14
 public interface DColorableIcon {
15
-	void draw(DCanvas canvas, DTransform2D transform, int color);
16
-	
17 15
 	void draw(DDrawTarget target, int z, DTransform2D transform, int color);
18 16
 	
19 17
 	float getNominalWidth();

+ 0
- 6
DrawableGui/src/main/java/org/openzen/drawablegui/DCompositeIcon.java View File

@@ -21,12 +21,6 @@ public class DCompositeIcon implements DColorableIcon {
21 21
 		this.addition = addition;
22 22
 		this.additionTransform = additionTransform;
23 23
 	}
24
-
25
-	@Override
26
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
27
-		base.draw(canvas, transform, color);
28
-		addition.draw(canvas, transform.mul(additionTransform), color);
29
-	}
30 24
 	
31 25
 	@Override
32 26
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {

+ 0
- 2
DrawableGui/src/main/java/org/openzen/drawablegui/DDrawable.java View File

@@ -12,8 +12,6 @@ import org.openzen.drawablegui.draw.DDrawTarget;
12 12
  * @author Hoofdgebruiker
13 13
  */
14 14
 public interface DDrawable {
15
-	void draw(DCanvas canvas, DTransform2D transform);
16
-	
17 15
 	void draw(DDrawTarget target, int z, DTransform2D transform);
18 16
 	
19 17
 	float getNominalWidth();

+ 0
- 2
DrawableGui/src/main/java/org/openzen/drawablegui/border/DCustomWindowBorder.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.drawablegui.border;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DComponent;
10 9
 import org.openzen.drawablegui.DSizing;
11 10
 import org.openzen.drawablegui.DMouseEvent;
@@ -154,7 +153,6 @@ public class DCustomWindowBorder implements DComponent {
154 153
 				background.setRectangle(bounds);
155 154
 			}
156 155
 		}
157
-		surface.repaint(bounds);
158 156
 	}
159 157
 
160 158
 	@Override

+ 0
- 1
DrawableGui/src/main/java/org/openzen/drawablegui/border/DPaddedBorder.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.drawablegui.border;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DIRectangle;
10 9
 import org.openzen.drawablegui.draw.DDrawSurface;
11 10
 

+ 0
- 7
DrawableGui/src/main/java/org/openzen/drawablegui/draw/DDrawSurface.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.drawablegui.draw;
7 7
 
8
-import org.openzen.drawablegui.DIRectangle;
9 8
 import org.openzen.drawablegui.DUIContext;
10 9
 import org.openzen.drawablegui.style.DStyleDefinition;
11 10
 import org.openzen.drawablegui.style.DStylePath;
@@ -20,10 +19,4 @@ public interface DDrawSurface extends DDrawTarget {
20 19
 	DStyleDefinition getStylesheet(DStylePath path);
21 20
 	
22 21
 	DSubSurface createSubSurface(int z);
23
-	
24
-	void repaint(int x, int y, int width, int height);
25
-	
26
-	default void repaint(DIRectangle rectangle) {
27
-		repaint(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
28
-	}
29 22
 }

+ 0
- 2
DrawableGui/src/main/java/org/openzen/drawablegui/draw/DSubSurface.java View File

@@ -21,6 +21,4 @@ public interface DSubSurface extends DDrawnElement, DDrawSurface {
21 21
 	void setOffset(int x, int y);
22 22
 	
23 23
 	void setClip(DIRectangle bounds);
24
-	
25
-	void repaint();
26 24
 }

+ 0
- 1
DrawableGui/src/main/java/org/openzen/drawablegui/form/DForm.java View File

@@ -8,7 +8,6 @@ package org.openzen.drawablegui.form;
8 8
 import java.util.function.Consumer;
9 9
 import java.util.function.Predicate;
10 10
 import org.openzen.drawablegui.BaseComponentGroup;
11
-import org.openzen.drawablegui.DCanvas;
12 11
 import org.openzen.drawablegui.DComponent;
13 12
 import org.openzen.drawablegui.DSizing;
14 13
 import org.openzen.drawablegui.DFontMetrics;

+ 0
- 1
DrawableGui/src/main/java/org/openzen/drawablegui/layout/DLinearLayout.java View File

@@ -8,7 +8,6 @@ package org.openzen.drawablegui.layout;
8 8
 import java.util.function.Consumer;
9 9
 import java.util.function.Predicate;
10 10
 import org.openzen.drawablegui.BaseComponentGroup;
11
-import org.openzen.drawablegui.DCanvas;
12 11
 import org.openzen.drawablegui.DComponent;
13 12
 import org.openzen.drawablegui.DIRectangle;
14 13
 import org.openzen.drawablegui.DSizing;

+ 0
- 2
DrawableGui/src/main/java/org/openzen/drawablegui/layout/DSideLayout.java View File

@@ -11,7 +11,6 @@ import java.util.List;
11 11
 import java.util.function.Consumer;
12 12
 import java.util.function.Predicate;
13 13
 import org.openzen.drawablegui.BaseComponentGroup;
14
-import org.openzen.drawablegui.DCanvas;
15 14
 import org.openzen.drawablegui.DComponent;
16 15
 import org.openzen.drawablegui.DIRectangle;
17 16
 import org.openzen.drawablegui.DSizing;
@@ -63,7 +62,6 @@ public class DSideLayout extends BaseComponentGroup {
63 62
 		if (surface != null && bounds != null) {
64 63
 			main.mount(path, z + 1, surface);
65 64
 			setBounds(bounds);
66
-			surface.repaint(bounds);
67 65
 		}
68 66
 	}
69 67
 

+ 0
- 3
DrawableGui/src/main/java/org/openzen/drawablegui/scroll/DScrollBar.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.drawablegui.scroll;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DComponent;
10 9
 import org.openzen.drawablegui.DSizing;
11 10
 import org.openzen.drawablegui.DMouseEvent;
@@ -172,7 +171,6 @@ public class DScrollBar implements DComponent {
172 171
 		
173 172
 		this.hovering = hovering;
174 173
 		updateBarColor();
175
-		surface.repaint(bounds.x, fromY, bounds.width, toY - fromY);
176 174
 	}
177 175
 	
178 176
 	private void setDragging(boolean dragging) {
@@ -181,7 +179,6 @@ public class DScrollBar implements DComponent {
181 179
 		
182 180
 		this.dragging = dragging;
183 181
 		updateBarColor();
184
-		surface.repaint(bounds.x, fromY, bounds.width, toY - fromY);
185 182
 	}
186 183
 	
187 184
 	private void recalculate() {

+ 0
- 1
DrawableGui/src/main/java/org/openzen/drawablegui/scroll/DScrollPane.java View File

@@ -6,7 +6,6 @@
6 6
 package org.openzen.drawablegui.scroll;
7 7
 
8 8
 import org.openzen.drawablegui.DAnchor;
9
-import org.openzen.drawablegui.DCanvas;
10 9
 import org.openzen.drawablegui.DClipboard;
11 10
 import org.openzen.drawablegui.DComponent;
12 11
 import org.openzen.drawablegui.DSizing;

+ 0
- 212
DrawableGui/src/main/java/org/openzen/drawablegui/swing/SwingCanvas.java View File

@@ -1,212 +0,0 @@
1
-/*
2
- * To change this license header, choose License Headers in Project Properties.
3
- * To change this template file, choose Tools | Templates
4
- * and open the template in the editor.
5
- */
6
-package org.openzen.drawablegui.swing;
7
-
8
-import java.awt.BasicStroke;
9
-import java.awt.Color;
10
-import java.awt.Font;
11
-import java.awt.Graphics2D;
12
-import java.awt.Rectangle;
13
-import java.awt.RenderingHints;
14
-import java.awt.geom.AffineTransform;
15
-import java.awt.geom.GeneralPath;
16
-import java.awt.image.BufferedImage;
17
-import java.awt.image.ConvolveOp;
18
-import java.awt.image.Kernel;
19
-import java.util.Stack;
20
-import org.openzen.drawablegui.DCanvas;
21
-import org.openzen.drawablegui.DFont;
22
-import org.openzen.drawablegui.DFontFamily;
23
-import org.openzen.drawablegui.DTransform2D;
24
-import org.openzen.drawablegui.DIRectangle;
25
-import org.openzen.drawablegui.DPath;
26
-import org.openzen.drawablegui.DPathBoundsCalculator;
27
-import org.openzen.drawablegui.DUIContext;
28
-import org.openzen.drawablegui.style.DShadow;
29
-
30
-/**
31
- *
32
- * @author Hoofdgebruiker
33
- */
34
-public class SwingCanvas implements DCanvas {
35
-	private final Graphics2D g;
36
-	private final SwingGraphicsContext context;
37
-	private final Stack<Rectangle> bounds = new Stack<>();
38
-	private final Stack<AffineTransform> transformStack = new Stack<>();
39
-	
40
-	public SwingCanvas(Graphics2D g, SwingGraphicsContext context, DIRectangle bounds) {
41
-		this.g = g;
42
-		
43
-		this.context = context;
44
-		
45
-		if (bounds != null)
46
-			pushBounds(new DIRectangle(bounds.x, bounds.y, bounds.width, bounds.height));
47
-	}
48
-	
49
-	@Override
50
-	public void pushBounds(DIRectangle bounds) {
51
-		this.bounds.push(g.getClipBounds());
52
-		g.setClip(bounds.x, bounds.y, bounds.width, bounds.height);
53
-	}
54
-	
55
-	@Override
56
-	public void popBounds() {
57
-		Rectangle bounds = this.bounds.pop();
58
-		g.setClip(bounds.x, bounds.y, bounds.width, bounds.height);
59
-	}
60
-	
61
-	@Override
62
-	public void pushOffset(int x, int y) {
63
-		transformStack.push(g.getTransform());
64
-		g.transform(AffineTransform.getTranslateInstance(x, y));
65
-	}
66
-	
67
-	@Override
68
-	public void popOffset() {
69
-		g.setTransform(transformStack.pop());
70
-	}
71
-	
72
-	@Override
73
-	public DIRectangle getBounds() {
74
-		Rectangle bounds = g.getClipBounds();
75
-		return new DIRectangle(bounds.x, bounds.y, bounds.width, bounds.height);
76
-	}
77
-
78
-	@Override
79
-	public void drawText(DFont font, int color, float x, float y, String text) {
80
-		prepare(font);
81
-		g.setColor(new Color(color, true));
82
-		g.setFont((Font) font.cached);
83
-		g.drawString(text, x, y);
84
-	}
85
-
86
-	@Override
87
-	public DUIContext getContext() {
88
-		return context;
89
-	}
90
-
91
-	@Override
92
-	public void strokePath(DPath path, DTransform2D transform, int color, float lineWidth) {
93
-		if (color == 0)
94
-			return;
95
-		
96
-		AffineTransform old = g.getTransform();
97
-		GeneralPath jPath = context.getPath(path);
98
-		g.setColor(new Color(color, true));
99
-		g.setStroke(new BasicStroke(lineWidth));
100
-		g.transform(getTransform(transform));
101
-		g.draw(jPath);
102
-		g.setTransform(old);
103
-	}
104
-
105
-	@Override
106
-	public void fillPath(DPath path, DTransform2D transform, int color) {
107
-		if (color == 0)
108
-			return;
109
-		
110
-		AffineTransform old = g.getTransform();
111
-		GeneralPath jPath = context.getPath(path);
112
-		g.setColor(new Color(color, true));
113
-		g.transform(getTransform(transform));
114
-		g.fill(jPath);
115
-		g.setTransform(old);
116
-	}
117
-
118
-	@Override
119
-	public void shadowPath(DPath path, DTransform2D transform, int color, DShadow shadow) {
120
-		if (shadow.color == 0) {
121
-			fillPath(path, transform, color);
122
-			return;
123
-		}
124
-		
125
-		if (shadow.radius == 0) {
126
-			fillPath(path, transform, shadow.color);
127
-			fillPath(path, transform, color);
128
-			return;
129
-		}
130
-		
131
-		DIRectangle bounds = DPathBoundsCalculator.getBounds(path, transform.offset(shadow.offsetX, shadow.offsetY));
132
-		int offset = 2 * (int)Math.ceil(shadow.radius);
133
-		
134
-		GeneralPath jPath = context.getPath(path);
135
-		
136
-		BufferedImage image = new BufferedImage(bounds.width + 2 * offset, bounds.height + 2 * offset, BufferedImage.TYPE_INT_ARGB_PRE);
137
-		Graphics2D imageG = (Graphics2D) image.getGraphics();
138
-		
139
-		imageG.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
140
-		imageG.setColor(new Color(shadow.color, true));
141
-		imageG.setTransform(getTransform(transform.offset(offset + shadow.offsetX - bounds.x, offset + shadow.offsetY - bounds.y)));
142
-		imageG.fill(jPath);
143
-		
144
-		image = getGaussianBlurFilter((int)Math.ceil(shadow.radius), true).filter(image, null);
145
-		image = getGaussianBlurFilter((int)Math.ceil(shadow.radius), false).filter(image, null);
146
-		g.drawImage(image, bounds.x - offset, bounds.y - offset, null);
147
-		
148
-		fillPath(path, transform, color);
149
-	}
150
-
151
-	@Override
152
-	public void fillRectangle(int x, int y, int width, int height, int color) {
153
-		if (color == 0)
154
-			return;
155
-		
156
-		g.setColor(new Color(color, true));
157
-		g.fillRect(x, y, width, height);
158
-	}
159
-	
160
-	public static void prepare(DFont font) {
161
-		if (font.cached != null && font.cached instanceof Font)
162
-			return;
163
-		
164
-		String baseFontName = font.family == DFontFamily.CODE ? "Consolas" : Font.DIALOG;
165
-		int style = 0;
166
-		if (font.bold)
167
-			style |= Font.BOLD;
168
-		if (font.italic)
169
-			style |= Font.ITALIC;
170
-		
171
-		font.cached = Font.decode(baseFontName).deriveFont(style, font.size);
172
-	}
173
-	
174
-	public static AffineTransform getTransform(DTransform2D transform) {
175
-		return new AffineTransform(transform.xx, transform.xy, transform.yx, transform.yy, transform.dx, transform.dy);
176
-	}
177
-    
178
-	
179
-	// taken from http://www.java2s.com/Code/Java/Advanced-Graphics/GaussianBlurDemo.htm
180
-    public static ConvolveOp getGaussianBlurFilter(int radius, boolean horizontal) {
181
-        if (radius < 1) {
182
-            throw new IllegalArgumentException("Radius must be >= 1");
183
-        }
184
-        
185
-        int size = radius * 2 + 1;
186
-        float[] data = new float[size];
187
-        
188
-        float sigma = radius / 3.0f;
189
-        float twoSigmaSquare = 2.0f * sigma * sigma;
190
-        float sigmaRoot = (float) Math.sqrt(twoSigmaSquare * Math.PI);
191
-        float total = 0.0f;
192
-        
193
-        for (int i = -radius; i <= radius; i++) {
194
-            float distance = i * i;
195
-            int index = i + radius;
196
-            data[index] = (float) Math.exp(-distance / twoSigmaSquare) / sigmaRoot;
197
-            total += data[index];
198
-        }
199
-        
200
-        for (int i = 0; i < data.length; i++) {
201
-            data[i] /= total;
202
-        }        
203
-        
204
-        Kernel kernel = null;
205
-        if (horizontal) {
206
-            kernel = new Kernel(size, 1, data);
207
-        } else {
208
-            kernel = new Kernel(1, size, data);
209
-        }
210
-        return new ConvolveOp(kernel, ConvolveOp.EDGE_NO_OP, null);
211
-    }
212
-}

+ 59
- 5
DrawableGui/src/main/java/org/openzen/drawablegui/swing/SwingDrawSurface.java View File

@@ -5,16 +5,19 @@
5 5
  */
6 6
 package org.openzen.drawablegui.swing;
7 7
 
8
+import java.awt.Font;
8 9
 import java.awt.Graphics2D;
9
-import java.awt.Rectangle;
10
+import java.awt.geom.AffineTransform;
11
+import java.awt.image.ConvolveOp;
12
+import java.awt.image.Kernel;
10 13
 import java.util.ArrayList;
11 14
 import java.util.List;
12 15
 import org.openzen.drawablegui.DFont;
16
+import org.openzen.drawablegui.DFontFamily;
13 17
 import org.openzen.drawablegui.DFontMetrics;
14 18
 import org.openzen.drawablegui.DIRectangle;
15 19
 import org.openzen.drawablegui.DPath;
16 20
 import org.openzen.drawablegui.DTransform2D;
17
-import org.openzen.drawablegui.DUIContext;
18 21
 import org.openzen.drawablegui.draw.DDrawSurface;
19 22
 import org.openzen.drawablegui.draw.DDrawnRectangle;
20 23
 import org.openzen.drawablegui.draw.DDrawnShape;
@@ -125,13 +128,11 @@ public class SwingDrawSurface implements DDrawSurface {
125 128
 		elements.remove(element);
126 129
 		repaint(element.getBounds());
127 130
 	}
128
-
129
-	@Override
131
+	
130 132
 	public void repaint(int x, int y, int width, int height) {
131 133
 		context.repaint(x + offsetX, y + offsetY, width, height);
132 134
 	}
133 135
 	
134
-	@Override
135 136
 	public void repaint(DIRectangle rectangle) {
136 137
 		context.repaint(rectangle.offset(offsetX, offsetY));
137 138
 	}
@@ -145,4 +146,57 @@ public class SwingDrawSurface implements DDrawSurface {
145 146
 		repaint(element.getBounds());
146 147
 		return element;
147 148
 	}
149
+	
150
+	public static void prepare(DFont font) {
151
+		if (font.cached != null && font.cached instanceof Font)
152
+			return;
153
+		
154
+		String baseFontName = font.family == DFontFamily.CODE ? "Consolas" : Font.DIALOG;
155
+		int style = 0;
156
+		if (font.bold)
157
+			style |= Font.BOLD;
158
+		if (font.italic)
159
+			style |= Font.ITALIC;
160
+		
161
+		font.cached = Font.decode(baseFontName).deriveFont(style, font.size);
162
+	}
163
+	
164
+	public static AffineTransform getTransform(DTransform2D transform) {
165
+		return new AffineTransform(transform.xx, transform.xy, transform.yx, transform.yy, transform.dx, transform.dy);
166
+	}
167
+    
168
+	
169
+	// taken from http://www.java2s.com/Code/Java/Advanced-Graphics/GaussianBlurDemo.htm
170
+    public static ConvolveOp getGaussianBlurFilter(int radius, boolean horizontal) {
171
+        if (radius < 1) {
172
+            throw new IllegalArgumentException("Radius must be >= 1");
173
+        }
174
+        
175
+        int size = radius * 2 + 1;
176
+        float[] data = new float[size];
177
+        
178
+        float sigma = radius / 3.0f;
179
+        float twoSigmaSquare = 2.0f * sigma * sigma;
180
+        float sigmaRoot = (float) Math.sqrt(twoSigmaSquare * Math.PI);
181
+        float total = 0.0f;
182
+        
183
+        for (int i = -radius; i <= radius; i++) {
184
+            float distance = i * i;
185
+            int index = i + radius;
186
+            data[index] = (float) Math.exp(-distance / twoSigmaSquare) / sigmaRoot;
187
+            total += data[index];
188
+        }
189
+        
190
+        for (int i = 0; i < data.length; i++) {
191
+            data[i] /= total;
192
+        }        
193
+        
194
+        Kernel kernel = null;
195
+        if (horizontal) {
196
+            kernel = new Kernel(size, 1, data);
197
+        } else {
198
+            kernel = new Kernel(1, size, data);
199
+        }
200
+        return new ConvolveOp(kernel, ConvolveOp.EDGE_NO_OP, null);
201
+    }
148 202
 }

+ 1
- 2
DrawableGui/src/main/java/org/openzen/drawablegui/swing/SwingDrawnText.java View File

@@ -11,7 +11,6 @@ import java.awt.Graphics2D;
11 11
 import org.openzen.drawablegui.DFont;
12 12
 import org.openzen.drawablegui.DIRectangle;
13 13
 import org.openzen.drawablegui.draw.DDrawnText;
14
-import static org.openzen.drawablegui.swing.SwingCanvas.prepare;
15 14
 
16 15
 /**
17 16
  *
@@ -29,7 +28,7 @@ public class SwingDrawnText extends SwingDrawnElement implements DDrawnText {
29 28
 	
30 29
 	public SwingDrawnText(SwingDrawSurface target, int z, float x, float y, int color, DFont font, String text, int ascent, int descent, int width) {
31 30
 		super(target, z);
32
-		prepare(font);
31
+		SwingDrawSurface.prepare(font);
33 32
 		
34 33
 		this.x = x;
35 34
 		this.y = y;

+ 2
- 3
DrawableGui/src/main/java/org/openzen/drawablegui/swing/SwingFilledPath.java View File

@@ -14,7 +14,6 @@ import org.openzen.drawablegui.DPath;
14 14
 import org.openzen.drawablegui.DPathBoundsCalculator;
15 15
 import org.openzen.drawablegui.DTransform2D;
16 16
 import org.openzen.drawablegui.draw.DDrawnShape;
17
-import static org.openzen.drawablegui.swing.SwingCanvas.getTransform;
18 17
 
19 18
 /**
20 19
  *
@@ -41,13 +40,13 @@ public class SwingFilledPath extends SwingDrawnElement implements DDrawnShape {
41 40
 		this.path = path;
42 41
 		
43 42
 		this.awtColor = color == 0 ? null : new Color(color, true);
44
-		this.transform = getTransform(transform);
43
+		this.transform = SwingDrawSurface.getTransform(transform);
45 44
 		this.bounds = DPathBoundsCalculator.getBounds(originalPath, transform);
46 45
 	}
47 46
 
48 47
 	@Override
49 48
 	public void setTransform(DTransform2D transform) {
50
-		this.transform = getTransform(transform);
49
+		this.transform = SwingDrawSurface.getTransform(transform);
51 50
 		this.bounds = DPathBoundsCalculator.getBounds(originalPath, transform);
52 51
 	}
53 52
 	

+ 1
- 1
DrawableGui/src/main/java/org/openzen/drawablegui/swing/SwingGraphicsContext.java View File

@@ -128,7 +128,7 @@ public class SwingGraphicsContext implements DUIContext {
128 128
 		if (graphics == null)
129 129
 			throw new AssertionError("No graphics available!");
130 130
 		
131
-		SwingCanvas.prepare(font);
131
+		SwingDrawSurface.prepare(font);
132 132
 		return new SwingFontMetrics(graphics.getFontMetrics((Font) font.cached), graphics);
133 133
 	}
134 134
 

+ 5
- 7
DrawableGui/src/main/java/org/openzen/drawablegui/swing/SwingShadowedPath.java View File

@@ -17,8 +17,6 @@ import org.openzen.drawablegui.DPathBoundsCalculator;
17 17
 import org.openzen.drawablegui.DTransform2D;
18 18
 import org.openzen.drawablegui.draw.DDrawnShape;
19 19
 import org.openzen.drawablegui.style.DShadow;
20
-import static org.openzen.drawablegui.swing.SwingCanvas.getGaussianBlurFilter;
21
-import static org.openzen.drawablegui.swing.SwingCanvas.getTransform;
22 20
 
23 21
 /**
24 22
  *
@@ -45,7 +43,7 @@ public class SwingShadowedPath extends SwingDrawnElement implements DDrawnShape
45 43
 			DShadow shadow) {
46 44
 		super(target, z);
47 45
 		
48
-		this.transform = getTransform(transform);
46
+		this.transform = SwingDrawSurface.getTransform(transform);
49 47
 		this.originalPath = originalPath;
50 48
 		this.path = path;
51 49
 		this.awtColor = new Color(color, true);
@@ -58,11 +56,11 @@ public class SwingShadowedPath extends SwingDrawnElement implements DDrawnShape
58 56
 		
59 57
 		imageG.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
60 58
 		imageG.setColor(new Color(shadow.color, true));
61
-		imageG.setTransform(getTransform(transform.offset(shadowOffset + shadow.offsetX - shadowBounds.x, shadowOffset + shadow.offsetY - shadowBounds.y)));
59
+		imageG.setTransform(SwingDrawSurface.getTransform(transform.offset(shadowOffset + shadow.offsetX - shadowBounds.x, shadowOffset + shadow.offsetY - shadowBounds.y)));
62 60
 		imageG.fill(path);
63 61
 		
64
-		image = getGaussianBlurFilter((int)Math.ceil(shadow.radius), true).filter(image, null);
65
-		image = getGaussianBlurFilter((int)Math.ceil(shadow.radius), false).filter(image, null);
62
+		image = SwingDrawSurface.getGaussianBlurFilter((int)Math.ceil(shadow.radius), true).filter(image, null);
63
+		image = SwingDrawSurface.getGaussianBlurFilter((int)Math.ceil(shadow.radius), false).filter(image, null);
66 64
 		shadowImage = image;
67 65
 		
68 66
 		bounds = new DIRectangle(
@@ -74,7 +72,7 @@ public class SwingShadowedPath extends SwingDrawnElement implements DDrawnShape
74 72
 
75 73
 	@Override
76 74
 	public void setTransform(DTransform2D transform) {
77
-		this.transform = getTransform(transform);
75
+		this.transform = SwingDrawSurface.getTransform(transform);
78 76
 	}
79 77
 	
80 78
 	@Override

+ 2
- 2
DrawableGui/src/main/java/org/openzen/drawablegui/swing/SwingStrokedPath.java View File

@@ -39,7 +39,7 @@ public class SwingStrokedPath extends SwingDrawnElement implements DDrawnShape {
39 39
 			float lineWidth) {
40 40
 		super(target, z);
41 41
 		
42
-		this.transform = SwingCanvas.getTransform(transform);
42
+		this.transform = SwingDrawSurface.getTransform(transform);
43 43
 		this.awtColor = color == 0 ? null : new Color(color, true);
44 44
 		this.originalPath = originalPath;
45 45
 		this.path = path;
@@ -50,7 +50,7 @@ public class SwingStrokedPath extends SwingDrawnElement implements DDrawnShape {
50 50
 	@Override
51 51
 	public void setTransform(DTransform2D transform) {
52 52
 		invalidate();
53
-		this.transform = SwingCanvas.getTransform(transform);
53
+		this.transform = SwingDrawSurface.getTransform(transform);
54 54
 		this.bounds = DPathBoundsCalculator.getBounds(originalPath, transform);
55 55
 		invalidate();
56 56
 	}

+ 0
- 37
DrawableGui/src/main/java/org/openzen/drawablegui/swing/SwingSubSurface.java View File

@@ -127,28 +127,7 @@ public class SwingSubSurface extends SwingDrawnElement implements DSubSurface {
127 127
 	public DSubSurface createSubSurface(int z) {
128 128
 		return surface.createSubSurface(z);
129 129
 	}
130
-
131
-	@Override
132
-	public void repaint(int x, int y, int width, int height) {
133
-		int left = toGlobalX(x);
134
-		int top = toGlobalY(y);
135
-		int right = left + width;
136
-		int bottom = top + height;
137
-
138
-		if (clip != null) {
139
-			left = Math.max(clip.x, left);
140
-			top = Math.max(clip.y, top);
141
-			right = Math.min(clip.x + clip.width, right);
142
-			bottom = Math.min(clip.y + clip.height, bottom);
143
-		}
144
-
145
-		if (left >= right || top >= bottom)
146
-			return;
147
-
148
-		target.repaint(left, top, right - left, bottom - top);
149
-	}
150 130
 	
151
-	@Override
152 131
 	public void repaint() {
153 132
 		DIRectangle bounds = surface.calculateBounds().offset(surface.offsetX, surface.offsetY);
154 133
 		if (clip != null)
@@ -156,20 +135,4 @@ public class SwingSubSurface extends SwingDrawnElement implements DSubSurface {
156 135
 		
157 136
 		target.repaint(bounds);
158 137
 	}
159
-
160
-	private int toGlobalX(int x) {
161
-		return x + surface.offsetX;
162
-	}
163
-
164
-	private int toGlobalY(int y) {
165
-		return y + surface.offsetY;
166
-	}
167
-
168
-	private int toLocalX(int x) {
169
-		return x - surface.offsetX;
170
-	}
171
-
172
-	private int toLocalY(int y) {
173
-		return y - surface.offsetY;
174
-	}
175 138
 }

+ 0
- 6
DrawableGui/src/main/java/org/openzen/drawablegui/tree/CollapsedArrow.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.drawablegui.tree;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DDrawable;
10 9
 import org.openzen.drawablegui.DTransform2D;
11 10
 import org.openzen.drawablegui.draw.DDrawTarget;
@@ -18,11 +17,6 @@ public class CollapsedArrow implements DDrawable {
18 17
 	public static final CollapsedArrow INSTANCE = new CollapsedArrow();
19 18
 	
20 19
 	private CollapsedArrow() {}
21
-
22
-	@Override
23
-	public void draw(DCanvas canvas, DTransform2D transform) {
24
-		ColoredCollapsedArrow.INSTANCE.draw(canvas, transform, 0xFF000000);
25
-	}
26 20
 	
27 21
 	@Override
28 22
 	public void draw(DDrawTarget target, int z, DTransform2D transform) {

+ 0
- 6
DrawableGui/src/main/java/org/openzen/drawablegui/tree/ColoredCollapsedArrow.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.drawablegui.tree;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DPath;
10 9
 import org.openzen.drawablegui.DTransform2D;
11 10
 import org.openzen.drawablegui.DColorableIcon;
@@ -23,11 +22,6 @@ public class ColoredCollapsedArrow implements DColorableIcon {
23 22
 		tracer.close();
24 23
 	};
25 24
 	
26
-	@Override
27
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
28
-		canvas.fillPath(PATH_0, transform, color);
29
-	}
30
-	
31 25
 	@Override
32 26
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {
33 27
 		target.fillPath(z, PATH_0, transform, color);

+ 13
- 12
DrawableGui/src/main/java/org/openzen/drawablegui/tree/DTreeView.java View File

@@ -50,6 +50,7 @@ public class DTreeView<N extends DTreeNode<N>> implements DComponent {
50 50
 	private final N root;
51 51
 	private final boolean showRoot;
52 52
 	private final List<Row> rows = new ArrayList<>();
53
+	private boolean selectedIsPresent = false;
53 54
 	
54 55
 	private DDrawnRectangle background;
55 56
 	private DDrawnRectangle selectedBackground;
@@ -163,20 +164,10 @@ public class DTreeView<N extends DTreeNode<N>> implements DComponent {
163 164
 				row.nodeIcon.setColor(style.selectedNodeTextColor);
164 165
 				
165 166
 				if (oldRowIndex >= 0) {
166
-					surface.repaint(
167
-							bounds.x,
168
-							rowToY(oldRowIndex) - style.selectedPaddingTop,
169
-							bounds.width,
170
-							fontMetrics.getAscent() + fontMetrics.getDescent() + style.selectedPaddingTop + style.selectedPaddingBottom);
171 167
 					Row oldRow = rows.get(oldRowIndex);
172 168
 					oldRow.text.setColor(style.nodeTextColor);
173 169
 					oldRow.nodeIcon.setColor(style.nodeTextColor);
174 170
 				}
175
-				surface.repaint(
176
-						bounds.x,
177
-						rowToY(rowIndex) - style.selectedPaddingTop,
178
-						bounds.width,
179
-						fontMetrics.getAscent() + fontMetrics.getDescent() + style.selectedPaddingTop + style.selectedPaddingBottom);
180 171
 			}
181 172
 		}
182 173
 	}
@@ -196,6 +187,7 @@ public class DTreeView<N extends DTreeNode<N>> implements DComponent {
196 187
 			row.close();
197 188
 		
198 189
 		rows.clear();
190
+		selectedIsPresent = false;
199 191
 		
200 192
 		if (showRoot) {
201 193
 			updateLayout(root, 0);
@@ -205,6 +197,12 @@ public class DTreeView<N extends DTreeNode<N>> implements DComponent {
205 197
 			}
206 198
 		}
207 199
 		
200
+		if (!selectedIsPresent) {
201
+			selectedNode = null;
202
+			selectedRow = -1;
203
+			selectedBackground.setColor(0);
204
+		}
205
+		
208 206
 		if (rows.size() != oldRowCount) {
209 207
 			DSizing preferences = sizing.getValue();
210 208
 			sizing.setValue(new DSizing(
@@ -254,6 +252,9 @@ public class DTreeView<N extends DTreeNode<N>> implements DComponent {
254 252
 			this.collapseListener = node.isCollapsed().addListener(this);
255 253
 			this.childListener = node.getChildren().addListener(this);
256 254
 			
255
+			if (node == selectedNode)
256
+				selectedIsPresent = true;
257
+			
257 258
 			int baseX = bounds.x + style.padding + x;
258 259
 			int baseY = (int)(bounds.y + style.padding + index * (fontMetrics.getAscent() + fontMetrics.getDescent() + style.rowSpacing));
259 260
 			
@@ -263,7 +264,7 @@ public class DTreeView<N extends DTreeNode<N>> implements DComponent {
263 264
 					z + 2,
264 265
 					node.getIcon(),
265 266
 					DTransform2D.translate(baseX + icon.getNominalWidth() + style.iconTextSpacing, baseY + fontMetrics.getAscent() + fontMetrics.getDescent() - icon.getNominalHeight()),
266
-					style.nodeTextColor);
267
+					node == selectedNode ? style.selectedNodeTextColor : style.nodeTextColor);
267 268
 			
268 269
 			if (!node.isLeaf())
269 270
 				collapseIcon = new DDrawableInstance(
@@ -275,7 +276,7 @@ public class DTreeView<N extends DTreeNode<N>> implements DComponent {
275 276
 			text = surface.drawText(
276 277
 					z + 2,
277 278
 					style.font,
278
-					style.nodeTextColor,
279
+					node == selectedNode ? style.selectedNodeTextColor : style.nodeTextColor,
279 280
 					baseX + style.iconTextSpacing + icon.getNominalWidth() + style.iconTextSpacing + node.getIcon().getNominalWidth(),
280 281
 					baseY + fontMetrics.getAscent(),
281 282
 					node.getTitle());

+ 0
- 6
DrawableGui/src/main/java/org/openzen/drawablegui/tree/ExpandedArrow.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.drawablegui.tree;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DDrawable;
10 9
 import org.openzen.drawablegui.DTransform2D;
11 10
 import org.openzen.drawablegui.draw.DDrawTarget;
@@ -19,11 +18,6 @@ public class ExpandedArrow implements DDrawable {
19 18
 	
20 19
 	private ExpandedArrow() {}
21 20
 
22
-	@Override
23
-	public void draw(DCanvas canvas, DTransform2D transform) {
24
-		ExpandedColoredArrow.INSTANCE.draw(canvas, transform, 0xFF000000);
25
-	}
26
-
27 21
 	@Override
28 22
 	public void draw(DDrawTarget target, int z, DTransform2D transform) {
29 23
 		ExpandedColoredArrow.INSTANCE.draw(target, z, transform, 0xFF000000);

+ 0
- 6
DrawableGui/src/main/java/org/openzen/drawablegui/tree/ExpandedColoredArrow.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.drawablegui.tree;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DPath;
10 9
 import org.openzen.drawablegui.DTransform2D;
11 10
 import org.openzen.drawablegui.DColorableIcon;
@@ -23,11 +22,6 @@ public class ExpandedColoredArrow implements DColorableIcon {
23 22
 		tracer.close();
24 23
 	};
25 24
 	
26
-	@Override
27
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
28
-		canvas.fillPath(PATH_0, transform, color);
29
-	}
30
-	
31 25
 	@Override
32 26
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {
33 27
 		target.fillPath(z, PATH_0, transform, color);

+ 2
- 9
DrawableGuiIconConverter/src/main/java/org/openzen/drawablegui/iconconverter/Main.java View File

@@ -72,16 +72,9 @@ public class Main {
72 72
 		
73 73
 		output.append("\t\n");
74 74
 		output.append("\t@Override\n");
75
-		output.append("\tpublic void draw(DCanvas canvas, DTransform2D transform, int color) {\n");
75
+		output.append("\tpublic void draw(DDrawTarget target, int z, DTransform2D transform, int color) {\n");
76 76
 		for (String pathName : pathNames) {
77
-			output.append("\t\tcanvas.fillPath(").append(pathName).append(", transform, color);\n");
78
-		}
79
-		output.append("\t}\n");
80
-		output.append("\n");
81
-		output.append("\t@Override\n");
82
-		output.append("\tpublic void draw(DDrawTarget target, int z, DTransform2D transform) {\n");
83
-		for (String pathName : pathNames) {
84
-			output.append("\t\target.fillPath(z, ").append(pathName).append(", transform, DDrawTarget.INSTANCE_COLOR);\n");
77
+			output.append("\t\target.fillPath(z, ").append(pathName).append(", transform, color);\n");
85 78
 		}
86 79
 		output.append("\t}\n");
87 80
 		output.append("\n");

+ 0
- 7
IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/AddBoxIcon.java View File

@@ -4,12 +4,10 @@
4 4
  * and open the template in the editor.
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.icons;
7
-import org.openzen.drawablegui.DCanvas;
8 7
 import org.openzen.drawablegui.DPath;
9 8
 import org.openzen.drawablegui.DTransform2D;
10 9
 import org.openzen.drawablegui.DColorableIcon;
11 10
 import org.openzen.drawablegui.draw.DDrawTarget;
12
-import org.openzen.drawablegui.style.DShadow;
13 11
 
14 12
 public class AddBoxIcon implements DColorableIcon {
15 13
 	public static final AddBoxIcon INSTANCE = new AddBoxIcon();
@@ -48,11 +46,6 @@ public class AddBoxIcon implements DColorableIcon {
48 46
 		tracer.close();
49 47
 	};
50 48
 	
51
-	@Override
52
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
53
-		canvas.shadowPath(PATH, transform, color, new DShadow(0xFF999999, 0, 1, 6));
54
-	}
55
-	
56 49
 	@Override
57 50
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {
58 51
 		target.fillPath(z, PATH, transform, color);

+ 0
- 6
IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/BuildIcon.java View File

@@ -4,7 +4,6 @@
4 4
  * and open the template in the editor.
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.icons;
7
-import org.openzen.drawablegui.DCanvas;
8 7
 import org.openzen.drawablegui.DPath;
9 8
 import org.openzen.drawablegui.DTransform2D;
10 9
 import org.openzen.drawablegui.DColorableIcon;
@@ -35,11 +34,6 @@ public class BuildIcon implements DColorableIcon {
35 34
 		tracer.close();
36 35
 	};
37 36
 	
38
-	@Override
39
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
40
-		canvas.shadowPath(PATH, transform, color, new DShadow(0xFFCCCCCC, 0, 1, 4));
41
-	}
42
-	
43 37
 	@Override
44 38
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {
45 39
 		target.shadowPath(z, PATH, transform, color, new DShadow(0xFFCCCCCC, 0, 1, 4));

+ 0
- 6
IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ChevronRight.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.icons;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DPath;
10 9
 import org.openzen.drawablegui.DTransform2D;
11 10
 import org.openzen.drawablegui.DColorableIcon;
@@ -26,11 +25,6 @@ public class ChevronRight implements DColorableIcon {
26 25
 		tracer.close();
27 26
 	};
28 27
 	
29
-	@Override
30
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
31
-		canvas.fillPath(PATH, transform, color);
32
-	}
33
-	
34 28
 	@Override
35 29
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {
36 30
 		target.fillPath(z, PATH, transform, color);

+ 0
- 6
IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/CloseIcon.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.icons;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DPath;
10 9
 import org.openzen.drawablegui.DTransform2D;
11 10
 import org.openzen.drawablegui.DColorableIcon;
@@ -32,11 +31,6 @@ public class CloseIcon implements DColorableIcon {
32 31
 		tracer.close();
33 32
 	};
34 33
 	
35
-	@Override
36
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
37
-		canvas.fillPath(PATH, transform, color);
38
-	}
39
-	
40 34
 	@Override
41 35
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {
42 36
 		target.fillPath(z, PATH, transform, color);

+ 0
- 6
IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/CodeIcon.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.icons;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DPath;
10 9
 import org.openzen.drawablegui.DTransform2D;
11 10
 import org.openzen.drawablegui.DColorableIcon;
@@ -37,11 +36,6 @@ public class CodeIcon implements DColorableIcon {
37 36
 		tracer.close();
38 37
 	};
39 38
 	
40
-	@Override
41
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
42
-		canvas.fillPath(PATH, transform, color);
43
-	}
44
-	
45 39
 	@Override
46 40
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {
47 41
 		target.fillPath(z, PATH, transform, color);

+ 0
- 6
IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ColoredIcon.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.icons;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DColorableIcon;
10 9
 import org.openzen.drawablegui.DDrawable;
11 10
 import org.openzen.drawablegui.DTransform2D;
@@ -24,11 +23,6 @@ public class ColoredIcon implements DDrawable {
24 23
 		this.color = color;
25 24
 	}
26 25
 
27
-	@Override
28
-	public void draw(DCanvas canvas, DTransform2D transform) {
29
-		icon.draw(canvas, transform, color);
30
-	}
31
-
32 26
 	@Override
33 27
 	public void draw(DDrawTarget target, int z, DTransform2D transform) {
34 28
 		icon.draw(target, z, transform, color);

+ 0
- 6
IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/FolderIcon.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.icons;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DPath;
10 9
 import org.openzen.drawablegui.DTransform2D;
11 10
 import org.openzen.drawablegui.DColorableIcon;
@@ -32,11 +31,6 @@ public class FolderIcon implements DColorableIcon {
32 31
 		tracer.close();
33 32
 	};
34 33
 	
35
-	@Override
36
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
37
-		canvas.fillPath(PATH, transform, color);
38
-	}
39
-	
40 34
 	@Override
41 35
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {
42 36
 		target.fillPath(z, PATH, transform, color);

+ 0
- 6
IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/LibraryIcon.java View File

@@ -9,7 +9,6 @@ package org.openzen.zenscript.ide.ui.icons;
9 9
  *
10 10
  * @author Hoofdgebruiker
11 11
  */
12
-import org.openzen.drawablegui.DCanvas;
13 12
 import org.openzen.drawablegui.DPath;
14 13
 import org.openzen.drawablegui.DTransform2D;
15 14
 import org.openzen.drawablegui.DColorableIcon;
@@ -44,11 +43,6 @@ public class LibraryIcon implements DColorableIcon {
44 43
 		tracer.close();
45 44
 	};
46 45
 	
47
-	@Override
48
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
49
-		canvas.fillPath(PATH, transform, color);
50
-	}
51
-	
52 46
 	@Override
53 47
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {
54 48
 		target.fillPath(z, PATH, transform, color);

+ 0
- 6
IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ModuleIcon.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.icons;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DPath;
10 9
 import org.openzen.drawablegui.DTransform2D;
11 10
 import org.openzen.drawablegui.DColorableIcon;
@@ -38,11 +37,6 @@ public class ModuleIcon implements DColorableIcon {
38 37
 		tracer.close();
39 38
 	};
40 39
 	
41
-	@Override
42
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
43
-		canvas.fillPath(PATH, transform, color);
44
-	}
45
-	
46 40
 	@Override
47 41
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {
48 42
 		target.fillPath(z, PATH, transform, color);

+ 0
- 6
IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/PlayIcon.java View File

@@ -4,7 +4,6 @@
4 4
  * and open the template in the editor.
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.icons;
7
-import org.openzen.drawablegui.DCanvas;
8 7
 import org.openzen.drawablegui.DPath;
9 8
 import org.openzen.drawablegui.DTransform2D;
10 9
 import org.openzen.drawablegui.DColorableIcon;
@@ -25,11 +24,6 @@ public class PlayIcon implements DColorableIcon {
25 24
 		tracer.close();
26 25
 	};
27 26
 	
28
-	@Override
29
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
30
-		canvas.shadowPath(PATH, transform, color, new DShadow(0xFFCCCCCC, 0, 1, 4));
31
-	}
32
-	
33 27
 	@Override
34 28
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {
35 29
 		target.shadowPath(z, PATH, transform, color, new DShadow(0xFFCCCCCC, 0, 1, 4));

+ 0
- 6
IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ProjectIcon.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.icons;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DPath;
10 9
 import org.openzen.drawablegui.DTransform2D;
11 10
 import org.openzen.drawablegui.DColorableIcon;
@@ -45,11 +44,6 @@ public class ProjectIcon implements DColorableIcon {
45 44
 		tracer.close();
46 45
 	};
47 46
 	
48
-	@Override
49
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
50
-		canvas.fillPath(PATH, transform, color);
51
-	}
52
-	
53 47
 	@Override
54 48
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {
55 49
 		target.fillPath(z, PATH, transform, color);

+ 0
- 6
IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/SaveIcon.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.icons;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DPath;
10 9
 import org.openzen.drawablegui.DTransform2D;
11 10
 import org.openzen.drawablegui.DColorableIcon;
@@ -43,11 +42,6 @@ public class SaveIcon implements DColorableIcon {
43 42
 		tracer.close();
44 43
 	};
45 44
 	
46
-	@Override
47
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
48
-		canvas.fillPath(PATH, transform, color);
49
-	}
50
-	
51 45
 	@Override
52 46
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {
53 47
 		target.fillPath(z, PATH, transform, color);

+ 0
- 6
IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ScalableCloseIcon.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.icons;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DPath;
10 9
 import org.openzen.drawablegui.DTransform2D;
11 10
 import org.openzen.drawablegui.DColorableIcon;
@@ -25,11 +24,6 @@ public class ScalableCloseIcon implements DColorableIcon {
25 24
 		};
26 25
 	}
27 26
 	
28
-	@Override
29
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
30
-		canvas.strokePath(path, transform, color, 1);
31
-	}
32
-	
33 27
 	@Override
34 28
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {
35 29
 		target.strokePath(z, path, transform, color, 1);

+ 0
- 6
IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ScalableMaximizeIcon.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.icons;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DPath;
10 9
 import org.openzen.drawablegui.DTransform2D;
11 10
 import org.openzen.drawablegui.DColorableIcon;
@@ -26,11 +25,6 @@ public class ScalableMaximizeIcon implements DColorableIcon {
26 25
 		};
27 26
 	}
28 27
 	
29
-	@Override
30
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
31
-		canvas.strokePath(path, transform, color, 1);
32
-	}
33
-	
34 28
 	@Override
35 29
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {
36 30
 		target.strokePath(z, path, transform, color, 1);

+ 0
- 6
IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ScalableMinimizeIcon.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.icons;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DColorableIcon;
10 9
 import org.openzen.drawablegui.DPath;
11 10
 import org.openzen.drawablegui.DTransform2D;
@@ -26,11 +25,6 @@ public class ScalableMinimizeIcon implements DColorableIcon {
26 25
 			tracer.lineTo(scale * 16, scale * 14);
27 26
 		};
28 27
 	}
29
-
30
-	@Override
31
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
32
-		canvas.strokePath(path, transform, color, 1);
33
-	}
34 28
 	
35 29
 	@Override
36 30
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {

+ 0
- 7
IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/SettingsIcon.java View File

@@ -4,12 +4,10 @@
4 4
  * and open the template in the editor.
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.icons;
7
-import org.openzen.drawablegui.DCanvas;
8 7
 import org.openzen.drawablegui.DPath;
9 8
 import org.openzen.drawablegui.DTransform2D;
10 9
 import org.openzen.drawablegui.DColorableIcon;
11 10
 import org.openzen.drawablegui.draw.DDrawTarget;
12
-import org.openzen.drawablegui.style.DShadow;
13 11
 
14 12
 public class SettingsIcon implements DColorableIcon {
15 13
 	public static final SettingsIcon INSTANCE = new SettingsIcon();
@@ -67,11 +65,6 @@ public class SettingsIcon implements DColorableIcon {
67 65
 		tracer.close();
68 66
 	};
69 67
 	
70
-	@Override
71
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
72
-		canvas.shadowPath(PATH, transform, color, new DShadow(0xFF888888, 0, 1, 4));
73
-	}
74
-	
75 68
 	@Override
76 69
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {
77 70
 		target.fillPath(z, PATH, transform, color);

+ 0
- 6
IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ShadedCodeIcon.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.icons;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DPath;
10 9
 import org.openzen.drawablegui.DTransform2D;
11 10
 import org.openzen.drawablegui.DColorableIcon;
@@ -37,11 +36,6 @@ public class ShadedCodeIcon implements DColorableIcon {
37 36
 		tracer.close();
38 37
 	};
39 38
 	
40
-	@Override
41
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
42
-		canvas.fillPath(PATH, transform, color);
43
-	}
44
-	
45 39
 	@Override
46 40
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {
47 41
 		target.fillPath(z, PATH, transform, color);

+ 0
- 6
IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ShadedProjectIcon.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.icons;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DPath;
10 9
 import org.openzen.drawablegui.DTransform2D;
11 10
 import org.openzen.drawablegui.DColorableIcon;
@@ -45,11 +44,6 @@ public class ShadedProjectIcon implements DColorableIcon {
45 44
 		tracer.close();
46 45
 	};
47 46
 	
48
-	@Override
49
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
50
-		canvas.fillPath(PATH, transform, color);
51
-	}
52
-	
53 47
 	@Override
54 48
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {
55 49
 		target.fillPath(z, PATH, transform, color);

+ 1
- 7
IDE/src/main/java/org/openzen/zenscript/ide/ui/icons/ShadedSaveIcon.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.icons;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DPath;
10 9
 import org.openzen.drawablegui.DTransform2D;
11 10
 import org.openzen.drawablegui.DColorableIcon;
@@ -44,14 +43,9 @@ public class ShadedSaveIcon implements DColorableIcon {
44 43
 		tracer.close();
45 44
 	};
46 45
 	
47
-	@Override
48
-	public void draw(DCanvas canvas, DTransform2D transform, int color) {
49
-		canvas.shadowPath(PATH, transform, color, new DShadow(0xFFCCCCCC, 0, 1, 4));
50
-	}
51
-	
52 46
 	@Override
53 47
 	public void draw(DDrawTarget target, int z, DTransform2D transform, int color) {
54
-		target.fillPath(z, PATH, transform, color);
48
+		target.shadowPath(z, PATH, transform, color, new DShadow(0xFFCCCCCC, 0, 1, 4));
55 49
 	}
56 50
 
57 51
 	@Override

+ 0
- 1
IDE/src/main/java/org/openzen/zenscript/ide/ui/view/IconButtonControl.java View File

@@ -6,7 +6,6 @@
6 6
 package org.openzen.zenscript.ide.ui.view;
7 7
 
8 8
 import java.util.function.Consumer;
9
-import org.openzen.drawablegui.DCanvas;
10 9
 import org.openzen.drawablegui.DComponent;
11 10
 import org.openzen.drawablegui.DSizing;
12 11
 import org.openzen.drawablegui.DDrawable;

+ 0
- 1
IDE/src/main/java/org/openzen/zenscript/ide/ui/view/StatusBarView.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.view;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DComponent;
10 9
 import org.openzen.drawablegui.DSizing;
11 10
 import org.openzen.drawablegui.DFontMetrics;

+ 11
- 16
IDE/src/main/java/org/openzen/zenscript/ide/ui/view/TabbedView.java View File

@@ -10,7 +10,6 @@ import java.util.Map;
10 10
 import java.util.function.Consumer;
11 11
 import java.util.function.Predicate;
12 12
 import org.openzen.drawablegui.BaseComponentGroup;
13
-import org.openzen.drawablegui.DCanvas;
14 13
 import org.openzen.drawablegui.DComponent;
15 14
 import org.openzen.drawablegui.DSizing;
16 15
 import org.openzen.drawablegui.DFontMetrics;
@@ -72,12 +71,12 @@ public class TabbedView extends BaseComponentGroup {
72 71
 			
73 72
 			if (newValue != null && bounds != null) {
74 73
 				DIRectangle contentBounds = new DIRectangle(
75
-					bounds.x, bounds.y + totalTabHeight,
76
-					bounds.width, bounds.height - totalTabHeight);
74
+						bounds.x + style.margin.left,
75
+						bounds.y + style.margin.top + totalTabHeight,
76
+						bounds.width - style.margin.getHorizontal(),
77
+						bounds.height - style.margin.getVertical() - totalTabHeight);
77 78
 				newValue.content.setBounds(contentBounds);
78 79
 			}
79
-			if (newValue == null && surface != null && bounds != null)
80
-				surface.repaint(bounds);
81 80
 		});
82 81
 	}
83 82
 	
@@ -126,8 +125,10 @@ public class TabbedView extends BaseComponentGroup {
126 125
 			return;
127 126
 		
128 127
 		DIRectangle contentBounds = new DIRectangle(
129
-				bounds.x, bounds.y + totalTabHeight,
130
-				bounds.width, bounds.height - totalTabHeight);
128
+				bounds.x + style.margin.left,
129
+				bounds.y + style.margin.top + totalTabHeight,
130
+				bounds.width - style.margin.getHorizontal(),
131
+				bounds.height - style.margin.getVertical() - totalTabHeight);
131 132
 		currentTab.getValue().content.setBounds(contentBounds);
132 133
 		layoutTabs();
133 134
 	}
@@ -144,10 +145,6 @@ public class TabbedView extends BaseComponentGroup {
144 145
 			tab.close();
145 146
 	}
146 147
 	
147
-	private void repaintTabs() {
148
-		surface.repaint(bounds.x, bounds.y, bounds.width, totalTabHeight);
149
-	}
150
-	
151 148
 	private void prepare(TabbedViewComponent tab) {
152 149
 		tab.content.mount(path, z + 1, surface);
153 150
 	}
@@ -156,16 +153,14 @@ public class TabbedView extends BaseComponentGroup {
156 153
 		if (bounds == null)
157 154
 			return;
158 155
 		
159
-		int x = bounds.x + style.tabBarSpacingLeft;
156
+		int x = bounds.x + style.margin.left + style.tabBarSpacingLeft;
160 157
 		for (DComponent tab : tabComponents) {
161 158
 			DSizing preferences = tab.getSizing().getValue();
162 159
 			tab.setBounds(new DIRectangle(
163
-					x, bounds.y + totalTabHeight - preferences.preferredHeight, preferences.preferredWidth, preferences.preferredHeight));
160
+					x, bounds.y + style.margin.top + totalTabHeight - preferences.preferredHeight, preferences.preferredWidth, preferences.preferredHeight));
164 161
 			
165 162
 			x += preferences.preferredWidth + style.tabSpacing;
166 163
 		}
167
-		
168
-		repaintTabs();
169 164
 	}
170 165
 
171 166
 	@Override
@@ -206,7 +201,7 @@ public class TabbedView extends BaseComponentGroup {
206 201
 
207 202
 		@Override
208 203
 		public void onChanged(int index, TabbedViewComponent oldValue, TabbedViewComponent newValue) {
209
-			repaintTabs();
204
+			
210 205
 		}
211 206
 
212 207
 		@Override

+ 0
- 1
IDE/src/main/java/org/openzen/zenscript/ide/ui/view/TabbedViewTab.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.view;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DComponent;
10 9
 import org.openzen.drawablegui.DSizing;
11 10
 import org.openzen.drawablegui.DFontMetrics;

+ 6
- 1
IDE/src/main/java/org/openzen/zenscript/ide/ui/view/WindowView.java View File

@@ -6,11 +6,13 @@
6 6
 package org.openzen.zenscript.ide.ui.view;
7 7
 
8 8
 import org.openzen.drawablegui.DEmptyView;
9
+import org.openzen.drawablegui.border.DLineBorder;
9 10
 import org.openzen.drawablegui.scroll.DScrollPane;
10 11
 import org.openzen.drawablegui.layout.DSideLayout;
11 12
 import org.openzen.drawablegui.live.LiveString;
12 13
 import org.openzen.drawablegui.live.SimpleLiveInt;
13 14
 import org.openzen.drawablegui.live.SimpleLiveString;
15
+import org.openzen.drawablegui.style.DShadow;
14 16
 import org.openzen.drawablegui.style.DStyleClass;
15 17
 import org.openzen.drawablegui.style.DStylesheetBuilder;
16 18
 import org.openzen.zenscript.ide.host.DevelopmentHost;
@@ -56,7 +58,10 @@ public final class WindowView extends DSideLayout {
56 58
 			TabbedViewComponent tab = new TabbedViewComponent(
57 59
 					sourceFile.getName(),
58 60
 					null,
59
-					new DScrollPane(DStyleClass.EMPTY, editor, new SimpleLiveInt(0)),
61
+					new DScrollPane(DStyleClass.inline(new DStylesheetBuilder()
62
+							.border("border", context -> new DLineBorder(0xFF888888, 1))
63
+							//.shadow("shadow", context -> new DShadow(0xFF888888, 0, 0.5f * context.getScale(), 3 * context.getScale()))
64
+							.build()), editor, new SimpleLiveInt(0)),
60 65
 					editor.isUpdated());
61 66
 			tabs.tabs.add(tab);
62 67
 			tabs.currentTab.setValue(tab);

+ 0
- 1
IDE/src/main/java/org/openzen/zenscript/ide/ui/view/aspectbar/AspectBarSelectorButton.java View File

@@ -6,7 +6,6 @@
6 6
 package org.openzen.zenscript.ide.ui.view.aspectbar;
7 7
 
8 8
 import java.util.function.Consumer;
9
-import org.openzen.drawablegui.DCanvas;
10 9
 import org.openzen.drawablegui.DComponent;
11 10
 import org.openzen.drawablegui.DSizing;
12 11
 import org.openzen.drawablegui.DDrawable;

+ 0
- 6
IDE/src/main/java/org/openzen/zenscript/ide/ui/view/aspectbar/AspectBarView.java View File

@@ -8,7 +8,6 @@ package org.openzen.zenscript.ide.ui.view.aspectbar;
8 8
 import java.util.function.Consumer;
9 9
 import java.util.function.Predicate;
10 10
 import org.openzen.drawablegui.BaseComponentGroup;
11
-import org.openzen.drawablegui.DCanvas;
12 11
 import org.openzen.drawablegui.DComponent;
13 12
 import org.openzen.drawablegui.DSizing;
14 13
 import org.openzen.drawablegui.DFontMetrics;
@@ -186,7 +185,6 @@ public class AspectBarView extends BaseComponentGroup {
186 185
 		if (surface != null) {
187 186
 			layout();
188 187
 			setupActiveBarText();
189
-			surface.repaint(bounds);
190 188
 		}
191 189
 	}
192 190
 
@@ -307,8 +305,6 @@ public class AspectBarView extends BaseComponentGroup {
307 305
 					style.backgroundColor,
308 306
 					style.windowControlShadow);
309 307
 		}
310
-		
311
-		surface.repaint(bounds);
312 308
 	}
313 309
 	
314 310
 	private void layoutAspectSelectorButtons() {
@@ -347,8 +343,6 @@ public class AspectBarView extends BaseComponentGroup {
347 343
 					new DIRectangle(x, bounds.y + y, width, height));
348 344
 			x += width;
349 345
 		}
350
-		
351
-		surface.repaint(bounds);
352 346
 	}
353 347
 
354 348
 	@Override

+ 0
- 1
IDE/src/main/java/org/openzen/zenscript/ide/ui/view/aspectbar/WindowActionButton.java View File

@@ -7,7 +7,6 @@ package org.openzen.zenscript.ide.ui.view.aspectbar;
7 7
 
8 8
 import java.util.function.Consumer;
9 9
 import java.util.function.Function;
10
-import org.openzen.drawablegui.DCanvas;
11 10
 import org.openzen.drawablegui.DColorableIcon;
12 11
 import org.openzen.drawablegui.DColorableIconInstance;
13 12
 import org.openzen.drawablegui.DComponent;

+ 1
- 24
IDE/src/main/java/org/openzen/zenscript/ide/ui/view/editor/SourceEditor.java View File

@@ -8,7 +8,6 @@ package org.openzen.zenscript.ide.ui.view.editor;
8 8
 import java.io.IOException;
9 9
 import java.util.ArrayList;
10 10
 import java.util.List;
11
-import org.openzen.drawablegui.DCanvas;
12 11
 import org.openzen.drawablegui.DComponent;
13 12
 import org.openzen.drawablegui.DSizing;
14 13
 import org.openzen.drawablegui.DFont;
@@ -289,17 +288,9 @@ public class SourceEditor implements DComponent {
289 288
 	}
290 289
 	
291 290
 	private void setCursor(SourcePosition start, SourcePosition end) {
292
-		int previousLine = cursorEnd == null ? -1 : cursorEnd.line;
293
-		
294 291
 		cursorStart = start;
295 292
 		cursorEnd = end;
296 293
 		
297
-		if (previousLine != cursorEnd.line) {
298
-			if (previousLine >= 0)
299
-				repaintLine(previousLine);
300
-			repaintLine(cursorEnd.line);
301
-		}
302
-		
303 294
 		clearMultilineSelection();
304 295
 		
305 296
 		int x = bounds.x + lineBarWidth + style.lineBarMargin;
@@ -331,12 +322,10 @@ public class SourceEditor implements DComponent {
331 322
 				}
332 323
 				
333 324
 				int toX = getX(to);
334
-				multiLineSelection.add(surface.fillRect(z + 2, new DIRectangle(x, getY(to), toX - x, selectionLineHeight), style.selectionColor));
325
+				multiLineSelection.add(surface.fillRect(z + 2, new DIRectangle(x, getY(to), Math.max(0, toX - x), selectionLineHeight), style.selectionColor));
335 326
 				selection.setRectangle(DIRectangle.EMPTY);
336 327
 			}
337 328
 		} else {
338
-			if (cursorEnd != null)
339
-				
340 329
 			selection.setRectangle(DIRectangle.EMPTY);
341 330
 		}
342 331
 		
@@ -603,13 +592,6 @@ public class SourceEditor implements DComponent {
603 592
 		unchanged.setValue(false);
604 593
 	}
605 594
 	
606
-	private void repaintLine(int line) {
607
-		if (bounds == null)
608
-			return;
609
-		
610
-		surface.repaint(bounds.x, lineToY(line), bounds.width, selectionLineHeight);
611
-	}
612
-	
613 595
 	public void scrollTo(SourcePosition position) {
614 596
 		surface.getContext().scrollInView(getX(position), getY(position), 2, selectionLineHeight);
615 597
 	}
@@ -704,9 +686,6 @@ public class SourceEditor implements DComponent {
704 686
 	
705 687
 	private void onLinesUpdated() {
706 688
 		sizing.setValue(new DSizing(0, fullLineHeight * tokens.getLineCount()));
707
-		
708
-		if (bounds != null)
709
-			surface.repaint(bounds);
710 689
 	}
711 690
 	
712 691
 	private void layoutLines(int fromIndex) {
@@ -754,8 +733,6 @@ public class SourceEditor implements DComponent {
754 733
 
755 734
 		@Override
756 735
 		public void onLineChanged(int index) {
757
-			repaintLine(index);
758
-			
759 736
 			if (bounds != null) {
760 737
 				removeLineTokens(drawnTokens.get(index));
761 738
 				drawnTokens.get(index).clear();

+ 0
- 1
IDE/src/main/java/org/openzen/zenscript/ide/ui/view/output/OutputView.java View File

@@ -5,7 +5,6 @@
5 5
  */
6 6
 package org.openzen.zenscript.ide.ui.view.output;
7 7
 
8
-import org.openzen.drawablegui.DCanvas;
9 8
 import org.openzen.drawablegui.DComponent;
10 9
 import org.openzen.drawablegui.DIRectangle;
11 10
 import org.openzen.drawablegui.DSizing;

Loading…
Cancel
Save