Skip to content
Snippets Groups Projects
Commit e18bf557 authored by Lukas Ladenberger's avatar Lukas Ladenberger
Browse files

minor changes

parent b4ebda7c
No related branches found
No related tags found
No related merge requests found
Showing with 43 additions and 48 deletions
......@@ -7,9 +7,7 @@
package de.bmotionstudio.gef.editor.figure;
import org.eclipse.draw2d.Clickable;
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.geometry.Rectangle;
/**
* @author Lukas Ladenberger
......@@ -17,8 +15,13 @@ import org.eclipse.draw2d.geometry.Rectangle;
*/
public class AbstractBMotionFigure extends Clickable {
private boolean visible = true;
private boolean isRunning = false;
private boolean visible;
private boolean isRunning;
public AbstractBMotionFigure() {
this.visible = true;
this.isRunning = false;
}
public void deactivateFigure() {
}
......@@ -38,21 +41,9 @@ public class AbstractBMotionFigure extends Clickable {
@Override
public void paint(Graphics g) {
if (!this.visible && !isRunning) {
Rectangle r = getClientArea();
g.setForegroundColor(ColorConstants.lightGray);
g.setLineStyle(Graphics.LINE_DOT);
g.drawRectangle(r.x, r.y, r.width - 1, r.height - 1);
g.setAlpha(15);
}
if (!this.visible && !isRunning)
g.setAlpha(25);
super.paint(g);
}
public boolean isRunning() {
......
......@@ -23,7 +23,8 @@ public class TableCellFigure extends AbstractTableFigure {
}
@Override
protected void paintBorder(Graphics g) {
public void paint(Graphics g) {
super.paint(g);
Rectangle r = getClientArea();
g.setBackgroundColor(backgroundColor);
g.fillRectangle(r.x, r.y, r.x + r.width, r.y + r.height);
......
......@@ -20,7 +20,8 @@ public class TableColumnFigure extends AbstractTableFigure {
}
@Override
protected void paintBorder(Graphics g) {
public void paint(Graphics g) {
super.paint(g);
Rectangle r = getClientArea();
Color foregroundColor = getForegroundColor();
if (foregroundColor != null)
......@@ -30,7 +31,6 @@ public class TableColumnFigure extends AbstractTableFigure {
g.drawLine(r.x, r.y, r.x, r.y + r.height - 15);
// Bottom line
g.drawLine(r.x, r.y + r.height - 15, r.x + r.width, r.y + r.height - 15);
super.paintBorder(g);
}
}
......@@ -20,13 +20,13 @@ public class TableFigure extends AbstractTableFigure {
}
@Override
protected void paintBorder(Graphics g) {
public void paint(Graphics g) {
super.paint(g);
Rectangle r = getClientArea();
g.setForegroundColor(getForegroundColor());
// Right table border line
g.drawLine(r.x + r.width - 21, r.y, r.x + r.width - 21, r.y + r.height
- 15);
super.paintBorder(g);
}
}
......@@ -14,6 +14,7 @@ import de.bmotionstudio.gef.editor.attribute.BAttributeHeight;
import de.bmotionstudio.gef.editor.attribute.BAttributeSize;
import de.bmotionstudio.gef.editor.attribute.BAttributeText;
import de.bmotionstudio.gef.editor.attribute.BAttributeTextColor;
import de.bmotionstudio.gef.editor.attribute.BAttributeVisible;
public class BTableCell extends BControl {
......@@ -44,6 +45,11 @@ public class BTableCell extends BControl {
aHeight.setEditable(false);
initAttribute(aHeight);
BAttributeVisible aVisible = new BAttributeVisible(true);
aVisible.setShow(false);
aVisible.setEditable(false);
initAttribute(aVisible);
}
@Override
......
......@@ -11,6 +11,7 @@ import org.eclipse.draw2d.ColorConstants;
import de.bmotionstudio.gef.editor.attribute.BAttributeForegroundColor;
import de.bmotionstudio.gef.editor.attribute.BAttributeHeight;
import de.bmotionstudio.gef.editor.attribute.BAttributeSize;
import de.bmotionstudio.gef.editor.attribute.BAttributeVisible;
public class BTableColumn extends BControl {
......@@ -35,6 +36,11 @@ public class BTableColumn extends BControl {
aHeight.setEditable(false);
initAttribute(aHeight);
BAttributeVisible aVisible = new BAttributeVisible(true);
aVisible.setShow(false);
aVisible.setEditable(false);
initAttribute(aVisible);
}
@Override
......
/**
* (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen,
* Heinrich Heine Universitaet Duesseldorf
* This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html)
* */
package de.bmotionstudio.gef.editor.part;
import java.beans.PropertyChangeEvent;
......@@ -42,21 +48,17 @@ public class BTableCellPart extends BMSAbstractEditPart {
Object value = evt.getNewValue();
String aID = evt.getPropertyName();
if (aID.equals(AttributeConstants.ATTRIBUTE_TEXT)) {
if (aID.equals(AttributeConstants.ATTRIBUTE_TEXT))
((TableCellFigure) figure).setText(value.toString());
}
if (aID.equals(AttributeConstants.ATTRIBUTE_BACKGROUND_COLOR)) {
if (aID.equals(AttributeConstants.ATTRIBUTE_BACKGROUND_COLOR))
((TableCellFigure) figure).setBackgroundColor((RGB) value);
}
if (aID.equals(AttributeConstants.ATTRIBUTE_TEXT_COLOR)) {
if (aID.equals(AttributeConstants.ATTRIBUTE_TEXT_COLOR))
((TableCellFigure) figure).setTextColor((RGB) value);
}
if (aID.equals(AttributeConstants.ATTRIBUTE_FOREGROUND_COLOR)) {
if (aID.equals(AttributeConstants.ATTRIBUTE_FOREGROUND_COLOR))
((TableCellFigure) figure).setForegroundColor((RGB) value);
}
if (aID.equals(AttributeConstants.ATTRIBUTE_FONT))
((TableCellFigure) figure).setFont((value.toString()));
......
/**
* (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen,
* Heinrich Heine Universitaet Duesseldorf
* This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html)
* */
package de.bmotionstudio.gef.editor.part;
import java.beans.PropertyChangeEvent;
......@@ -49,29 +55,12 @@ public class BTableColumnPart extends BMSAbstractEditPart {
Object value = evt.getNewValue();
String aID = evt.getPropertyName();
// if (aID.equals(AttributeConstants.ATTRIBUTE_BACKGROUND_COLOR)) {
// for (BControl cell : model.getChildrenArray())
// cell.setAttributeValue(
// AttributeConstants.ATTRIBUTE_BACKGROUND_COLOR, value);
// }
//
if (aID.equals(AttributeConstants.ATTRIBUTE_FOREGROUND_COLOR)) {
((TableColumnFigure) figure).setForegroundColor((RGB) value);
for (BControl cell : model.getChildrenArray())
cell.setAttributeValue(
AttributeConstants.ATTRIBUTE_FOREGROUND_COLOR, value);
}
//
// if (aID.equals(AttributeConstants.ATTRIBUTE_TEXT_COLOR)) {
// for (BControl cell : model.getChildrenArray())
// cell.setAttributeValue(AttributeConstants.ATTRIBUTE_TEXT_COLOR,
// value);
// }
//
// if (aID.equals(AttributeConstants.ATTRIBUTE_FONT)) {
// for (BControl cell : model.getChildrenArray())
// cell.setAttributeValue(AttributeConstants.ATTRIBUTE_FONT, value);
// }
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment