Search in sources :

Example 21 with AccessRules

use of com.ramussoft.common.AccessRules in project ramus by Vitaliy-Yakovchuk.

the class XMLComponentFramefork method createTableComponentFactory.

private ComponentFactory createTableComponentFactory() {
    return new AbstractComponentFactory() {

        @Override
        public String getType() {
            return "Table";
        }

        @Override
        public Component createComponent(Diagram diagram, Engine engine, AccessRules accessRules, Bounds bounds) {
            Table label = new Table();
            label.setWidth(((XMLDiagram) diagram).getWidthForCompontns());
            return label;
        }

        @Override
        public Component getComponent(Engine engine, AccessRules accessRules, Bounds bounds) {
            return null;
        }
    };
}
Also used : Table(com.ramussoft.report.editor.xml.components.Table) Bounds(com.ramussoft.reportgef.model.Bounds) AccessRules(com.ramussoft.common.AccessRules) AbstractComponentFactory(com.ramussoft.reportgef.AbstractComponentFactory) Engine(com.ramussoft.common.Engine) Diagram(com.ramussoft.reportgef.gui.Diagram)

Example 22 with AccessRules

use of com.ramussoft.common.AccessRules 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;
        }
    };
}
Also used : Bounds(com.ramussoft.reportgef.model.Bounds) AccessRules(com.ramussoft.common.AccessRules) AbstractComponentFactory(com.ramussoft.reportgef.AbstractComponentFactory) TableColumn(com.ramussoft.report.editor.xml.components.TableColumn) Engine(com.ramussoft.common.Engine) Diagram(com.ramussoft.reportgef.gui.Diagram)

Example 23 with AccessRules

use of com.ramussoft.common.AccessRules in project ramus by Vitaliy-Yakovchuk.

the class FunctionOptionsDialog method apptype.

private void apptype() {
    Engine e = dataPlugin.getEngine();
    if (e instanceof Journaled)
        ((Journaled) e).startUserTransaction();
    function.setFont(getJFontChooser().getSelFont());
    function.setBackground(getJColorChooser().getColor());
    function.setForeground(getJColorChooser1().getColor());
    final JList jList = selectOwner.getJList();
    if (jList.getSelectedIndex() == 0)
        function.setOwner(null);
    else {
        function.setOwner((Row) jList.getSelectedValue());
    }
    function.setType(functionType.getType());
    AccessRules rules = dataPlugin.getAccessRules();
    Element element = ((NFunction) function).getElement();
    for (int index = attributes.size() - 1; index >= 0; index--) {
        Attribute attribute = attributes.get(index);
        if (rules.canUpdateElement(element.getId(), attribute.getId())) {
            Object value = attributeEditors.get(index).getValue();
            if (!equals(value, values.get(index)))
                e.setAttribute(element, attribute, value);
        }
    }
    if (e instanceof Journaled)
        ((Journaled) e).commitUserTransaction();
}
Also used : Journaled(com.ramussoft.common.journal.Journaled) NFunction(com.ramussoft.pb.data.negine.NFunction) Attribute(com.ramussoft.common.Attribute) Element(com.ramussoft.common.Element) AccessRules(com.ramussoft.common.AccessRules) IDEF0Object(com.ramussoft.pb.idef.visual.IDEF0Object) Engine(com.ramussoft.common.Engine) JList(javax.swing.JList)

Aggregations

AccessRules (com.ramussoft.common.AccessRules)23 Engine (com.ramussoft.common.Engine)21 Attribute (com.ramussoft.common.Attribute)9 PluginFactory (com.ramussoft.common.PluginFactory)5 Row (com.ramussoft.database.common.Row)5 ArrayList (java.util.ArrayList)5 PluginProvider (com.ramussoft.common.PluginProvider)4 Qualifier (com.ramussoft.common.Qualifier)4 MemoryDatabase (com.ramussoft.database.MemoryDatabase)4 RowRootCreater (com.ramussoft.gui.qualifier.table.RowRootCreater)4 RowTreeTableComponent (com.ramussoft.gui.qualifier.table.RowTreeTableComponent)4 ActionEvent (java.awt.event.ActionEvent)4 AbstractAction (javax.swing.AbstractAction)4 AttributePreferenciesEditor (com.ramussoft.gui.common.AttributePreferenciesEditor)3 TreeTableNode (com.ramussoft.gui.qualifier.table.TreeTableNode)3 SelectionEvent (com.ramussoft.gui.qualifier.table.event.SelectionEvent)3 AbstractComponentFactory (com.ramussoft.reportgef.AbstractComponentFactory)3 Diagram (com.ramussoft.reportgef.gui.Diagram)3 Bounds (com.ramussoft.reportgef.model.Bounds)3 File (java.io.File)3