use of com.ramussoft.reportgef.model.Bounds in project ramus by Vitaliy-Yakovchuk.
the class XMLComponentFramefork method createTableColumnFactory.
private ComponentFactory createTableColumnFactory() {
return new AbstractComponentFactory() {
@Override
public String getType() {
return "TableColumn";
}
@Override
public Component createComponent(Diagram diagram, Engine engine, AccessRules accessRules, Bounds bounds) {
TableColumn label = new TableColumn();
label.setWidth(((XMLDiagram) diagram).getWidthForCompontns());
return label;
}
@Override
public Component getComponent(Engine engine, AccessRules accessRules, Bounds bounds) {
return null;
}
};
}
use of com.ramussoft.reportgef.model.Bounds in project ramus by Vitaliy-Yakovchuk.
the class Table method applyTransformForGroup.
public void applyTransformForGroup(Group group, Diagram diagram) {
List<TableColumn> list = new ArrayList<TableColumn>();
for (Bounds bounds : group.getBounds()) {
Component component = diagram.getComponent(bounds);
if ((component instanceof TableColumn) && (((TableColumn) component).getTable().equals(this)))
list.add((TableColumn) component);
}
if (list.size() <= 0)
return;
int index = getNewIndex(group.getTranslate().getX(), list.get(0), diagram);
if (index < 0)
return;
int realIndex = -1;
List<TableColumn> columns = new ArrayList<TableColumn>();
for (int i = 0; i < this.columns.length; i++) {
TableColumn column = this.columns[i];
if (list.indexOf(column) < 0) {
if (i == index)
realIndex = columns.size();
columns.add(column);
}
}
if (realIndex < 0)
realIndex = columns.size();
for (TableColumn column : list) {
columns.add(realIndex, column);
realIndex++;
}
this.columns = columns.toArray(new TableColumn[columns.size()]);
applyComlumnsSize((QBounds) diagram.getBounds(this), diagram);
}
use of com.ramussoft.reportgef.model.Bounds in project ramus by Vitaliy-Yakovchuk.
the class GEFComponent method mousePressed.
@Override
public void mousePressed(MouseEvent e) {
if (e.getButton() == MouseEvent.BUTTON1) {
Bounds[] bounds = selection.getBounds();
mousePressed(translateMouseEvent(e));
if (e.isControlDown()) {
Bounds[] bounds2 = selection.getBounds();
if (!Arrays.equals(bounds, bounds2)) {
Bounds[] bounds3 = Arrays.copyOf(bounds, bounds.length + bounds2.length);
for (int i = 0; i < bounds2.length; i++) {
bounds3[i + bounds.length] = bounds2[i];
}
selection.setBounds(bounds3);
selectionChanged();
}
}
}
}
use of com.ramussoft.reportgef.model.Bounds in project ramus by Vitaliy-Yakovchuk.
the class GEFComponent method getSelected.
private Bounds getSelected(Point point) {
Bounds[] bounds = diagram.getBounds();
double x = untranslate(point.getX());
double y = untranslate(point.getY());
Bounds bounds3 = null;
for (int i = bounds.length - 1; i >= 0; i--) {
Bounds bounds2 = bounds[i];
if ((bounds2.getLeft() < x) && (bounds2.getTop() < y) && (bounds2.getRight() > x) && (bounds2.getBottom() > y)) {
bounds3 = bounds2;
break;
}
}
return bounds3;
}
use of com.ramussoft.reportgef.model.Bounds in project ramus by Vitaliy-Yakovchuk.
the class GEFComponent method mousePressed.
public void mousePressed(Point point) {
synchronized (mouseLock) {
mousePressedPosition = point;
mouseDragPosition = mousePressedPosition;
mouseDragged = false;
Bounds bounds = getSelected(point);
setDragSides(point);
drag = false;
if (bounds == null) {
if (selection.getBounds().length > 0) {
if (dragSides.size() == 0) {
selection.setBounds(new Bounds[] {});
selectionChanged();
}
}
} else {
boolean selected = false;
for (Bounds bounds2 : selection.getBounds()) {
if (bounds2.equals(bounds))
selected = true;
}
if (!selected) {
selection.setBounds(new Bounds[] { bounds });
}
selectionChanged();
}
}
}
Aggregations