Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Thienel2016-03-20 09:51:44 -0400
committerFlorian Thienel2016-03-20 09:51:44 -0400
commitd0b32beaa6a450d6529869c68b987a7cd8d28edd (patch)
tree38a0056ab55274b6a624985a2a9250fafec63083
parent41704112682dc35606e890fd4eca7b88bad2941d (diff)
downloadorg.eclipse.mylyn.docs.vex-d0b32beaa6a450d6529869c68b987a7cd8d28edd.tar.gz
org.eclipse.mylyn.docs.vex-d0b32beaa6a450d6529869c68b987a7cd8d28edd.tar.xz
org.eclipse.mylyn.docs.vex-d0b32beaa6a450d6529869c68b987a7cd8d28edd.zip
remove the wrong abstraction of IVisualDecorator
Signed-off-by: Florian Thienel <florian@thienel.org>
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/HorizontalBar.java19
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/IStructuralBox.java6
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/IVisualDecorator.java15
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/List.java15
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/ListItem.java20
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/Paragraph.java19
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/StructuralFrame.java19
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/StructuralNodeReference.java19
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/VerticalBlock.java19
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/widget/DOMVisualization.java6
10 files changed, 0 insertions, 157 deletions
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/HorizontalBar.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/HorizontalBar.java
index 394bb145..7c891885 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/HorizontalBar.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/HorizontalBar.java
@@ -26,7 +26,6 @@ public class HorizontalBar extends BaseBox implements IStructuralBox {
private int width;
private int height;
private Color color;
- private IVisualDecorator<IStructuralBox> visualDecorator;
@Override
public void setParent(final IBox parent) {
@@ -128,22 +127,4 @@ public class HorizontalBar extends BaseBox implements IStructuralBox {
graphics.setColor(colorResource);
graphics.fillRect(0, 0, width, height);
}
-
- @Override
- public void setVisualDecorator(final IVisualDecorator<IStructuralBox> visualDecorator) {
- this.visualDecorator = visualDecorator;
-
- }
-
- @Override
- public void resetVisualDecorator() {
- visualDecorator = null;
- }
-
- @Override
- public void applyVisualDecorator() {
- if (visualDecorator != null) {
- visualDecorator.decorate(this);
- }
- }
}
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/IStructuralBox.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/IStructuralBox.java
index 6234319c..5187805d 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/IStructuralBox.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/IStructuralBox.java
@@ -25,10 +25,4 @@ public interface IStructuralBox extends IChildBox {
* The bounds are always relative to the parent box.
*/
Rectangle getBounds();
-
- void setVisualDecorator(IVisualDecorator<IStructuralBox> visualDecorator);
-
- void resetVisualDecorator();
-
- void applyVisualDecorator();
}
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/IVisualDecorator.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/IVisualDecorator.java
deleted file mode 100644
index 31899fae..00000000
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/IVisualDecorator.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2016 Florian Thienel and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Florian Thienel - initial API and implementation
- *******************************************************************************/
-package org.eclipse.vex.core.internal.boxes;
-
-public interface IVisualDecorator<T extends IBox> {
- void decorate(T box);
-} \ No newline at end of file
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/List.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/List.java
index 773bf345..b09a4fe1 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/List.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/List.java
@@ -188,19 +188,4 @@ public class List extends BaseBox implements IStructuralBox, IDecoratorBox<IStru
public void paint(final Graphics graphics) {
ChildBoxPainter.paint(component, graphics);
}
-
- @Override
- public void setVisualDecorator(final IVisualDecorator<IStructuralBox> visualDecorator) {
- // ignore, will be removed anyway
- }
-
- @Override
- public void resetVisualDecorator() {
- // ignore, will be removed anyway
- }
-
- @Override
- public void applyVisualDecorator() {
- // ignore, will be removed anyway
- }
}
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/ListItem.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/ListItem.java
index b93e59cb..2c58e9a8 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/ListItem.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/ListItem.java
@@ -38,8 +38,6 @@ public class ListItem extends BaseBox implements IStructuralBox, IDecoratorBox<I
private Paragraph bulletContainer;
private IStructuralBox component;
- private IVisualDecorator<IStructuralBox> visualDecorator;
-
@Override
public void setParent(final IBox parent) {
this.parent = parent;
@@ -362,22 +360,4 @@ public class ListItem extends BaseBox implements IStructuralBox, IDecoratorBox<I
}
ChildBoxPainter.paint(component, graphics);
}
-
- @Override
- public void setVisualDecorator(final IVisualDecorator<IStructuralBox> visualDecorator) {
- this.visualDecorator = visualDecorator;
-
- }
-
- @Override
- public void resetVisualDecorator() {
- visualDecorator = null;
- }
-
- @Override
- public void applyVisualDecorator() {
- if (visualDecorator != null) {
- visualDecorator.decorate(this);
- }
- }
}
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/Paragraph.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/Paragraph.java
index 59d4ca54..95dd6475 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/Paragraph.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/Paragraph.java
@@ -32,7 +32,6 @@ public class Paragraph extends BaseBox implements IStructuralBox, IParentBox<IIn
private final LinkedList<IInlineBox> children = new LinkedList<IInlineBox>();
private final LineArrangement lines = new LineArrangement();
- private IVisualDecorator<IStructuralBox> visualDecorator;
@Override
public void setParent(final IBox parent) {
@@ -208,22 +207,4 @@ public class Paragraph extends BaseBox implements IStructuralBox, IParentBox<IIn
line.paint(graphics);
}
}
-
- @Override
- public void setVisualDecorator(final IVisualDecorator<IStructuralBox> visualDecorator) {
- this.visualDecorator = visualDecorator;
-
- }
-
- @Override
- public void resetVisualDecorator() {
- visualDecorator = null;
- }
-
- @Override
- public void applyVisualDecorator() {
- if (visualDecorator != null) {
- visualDecorator.decorate(this);
- }
- }
}
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/StructuralFrame.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/StructuralFrame.java
index 0ddec289..8c05e4e0 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/StructuralFrame.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/StructuralFrame.java
@@ -31,7 +31,6 @@ public class StructuralFrame extends BaseBox implements IStructuralBox, IDecorat
private Color backgroundColor = null;
private IStructuralBox component;
- private IVisualDecorator<IStructuralBox> visualDecorator;
@Override
public void setParent(final IBox parent) {
@@ -231,22 +230,4 @@ public class StructuralFrame extends BaseBox implements IStructuralBox, IDecorat
private void paintComponent(final Graphics graphics) {
ChildBoxPainter.paint(component, graphics);
}
-
- @Override
- public void setVisualDecorator(final IVisualDecorator<IStructuralBox> visualDecorator) {
- this.visualDecorator = visualDecorator;
-
- }
-
- @Override
- public void resetVisualDecorator() {
- visualDecorator = null;
- }
-
- @Override
- public void applyVisualDecorator() {
- if (visualDecorator != null) {
- visualDecorator.decorate(this);
- }
- }
}
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/StructuralNodeReference.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/StructuralNodeReference.java
index 134453cd..a9a8ba20 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/StructuralNodeReference.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/StructuralNodeReference.java
@@ -38,7 +38,6 @@ public class StructuralNodeReference extends BaseBox implements IStructuralBox,
private INode node;
private boolean canContainText;
private boolean containsInlineContent;
- private IVisualDecorator<IStructuralBox> visualDecorator;
@Override
public void setParent(final IBox parent) {
@@ -322,24 +321,6 @@ public class StructuralNodeReference extends BaseBox implements IStructuralBox,
}
@Override
- public void setVisualDecorator(final IVisualDecorator<IStructuralBox> visualDecorator) {
- this.visualDecorator = visualDecorator;
-
- }
-
- @Override
- public void resetVisualDecorator() {
- visualDecorator = null;
- }
-
- @Override
- public void applyVisualDecorator() {
- if (visualDecorator != null) {
- visualDecorator.decorate(this);
- }
- }
-
- @Override
public String toString() {
String result = "StructuralNodeReference{ ";
result += "x: " + left + ", y: " + top + ", width: " + width + ", height: " + height;
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/VerticalBlock.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/VerticalBlock.java
index f4da57c5..43c63240 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/VerticalBlock.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/VerticalBlock.java
@@ -31,7 +31,6 @@ public class VerticalBlock extends BaseBox implements IStructuralBox, IParentBox
private int width;
private int height;
private final ArrayList<IStructuralBox> children = new ArrayList<IStructuralBox>();
- private IVisualDecorator<IStructuralBox> visualDecorator;
@Override
public void setParent(final IBox parent) {
@@ -169,22 +168,4 @@ public class VerticalBlock extends BaseBox implements IStructuralBox, IParentBox
public void paint(final Graphics graphics) {
ChildBoxPainter.paint(children, graphics);
}
-
- @Override
- public void setVisualDecorator(final IVisualDecorator<IStructuralBox> visualDecorator) {
- this.visualDecorator = visualDecorator;
-
- }
-
- @Override
- public void resetVisualDecorator() {
- visualDecorator = null;
- }
-
- @Override
- public void applyVisualDecorator() {
- if (visualDecorator != null) {
- visualDecorator.decorate(this);
- }
- }
}
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/widget/DOMVisualization.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/widget/DOMVisualization.java
index abd304ea..eedf7a12 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/widget/DOMVisualization.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/widget/DOMVisualization.java
@@ -114,37 +114,31 @@ public class DOMVisualization {
@Override
public void visit(final VerticalBlock box) {
box.replaceChildren(modifiedBoxes, boxModelBuilder.visualizeStructure(node));
- box.applyVisualDecorator();
}
@Override
public void visit(final StructuralFrame box) {
box.setComponent(boxModelBuilder.visualizeStructure(node));
- box.applyVisualDecorator();
}
@Override
public void visit(final StructuralNodeReference box) {
box.setComponent(boxModelBuilder.visualizeStructure(node));
- box.applyVisualDecorator();
}
@Override
public void visit(final ListItem box) {
box.setComponent(boxModelBuilder.visualizeStructure(node));
- box.applyVisualDecorator();
}
@Override
public void visit(final List box) {
box.setComponent(boxModelBuilder.visualizeStructure(node));
- box.applyVisualDecorator();
}
@Override
public void visit(final Paragraph box) {
box.replaceChildren(modifiedBoxes, boxModelBuilder.visualizeInline(node));
- box.applyVisualDecorator();
}
@Override

Back to the top