Search in sources :

Example 46 with Attribute

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

the class ChartPlugin method createDouble.

private Attribute createDouble(String attributeName) {
    Attribute attribute = engine.createSystemAttribute(new AttributeType("Core", "Double"));
    attribute.setName(attributeName);
    engine.updateAttribute(attribute);
    return attribute;
}
Also used : Attribute(com.ramussoft.common.Attribute) AttributeType(com.ramussoft.common.AttributeType)

Example 47 with Attribute

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

the class ChartPlugin method createCharts.

private Qualifier createCharts() {
    Qualifier qualifier = engine.createSystemQualifier();
    qualifier.setName(QUALIFIER_CHARTS);
    Attribute attribute = StandardAttributesPlugin.getAttributeNameAttribute(engine);
    qualifier.getAttributes().add(attribute);
    qualifier.getSystemAttributes().add(StandardAttributesPlugin.getHierarchicalAttribute(engine));
    qualifier.setAttributeForName(attribute.getId());
    engine.updateQualifier(qualifier);
    return qualifier;
}
Also used : Attribute(com.ramussoft.common.Attribute) Qualifier(com.ramussoft.common.Qualifier)

Example 48 with Attribute

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

the class ChartPlugin method createLong.

private Attribute createLong(String attributeName) {
    Attribute attribute = engine.createSystemAttribute(new AttributeType("Core", "Long"));
    attribute.setName(attributeName);
    engine.updateAttribute(attribute);
    return attribute;
}
Also used : Attribute(com.ramussoft.common.Attribute) AttributeType(com.ramussoft.common.AttributeType)

Example 49 with Attribute

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

the class NFunction method setName.

@Override
public void setName(String name) {
    Row row = dataPlugin.findRowByGlobalId(getLink());
    if (row != null)
        row.setName(name);
    else {
        Attribute attribute = engine.getAttribute(rowSet.getQualifier().getAttributeForName());
        if (attribute.getAttributeType().toString().equals("IDEF0.DFDSName")) {
            DFDSName dfdsName = new DFDSName();
            int r = name.indexOf('\n');
            if (r >= 0) {
                dfdsName.setShortName(name.substring(0, r));
                dfdsName.setLongName(name.substring(r + 1));
            } else {
                dfdsName.setShortName(name);
                dfdsName.setLongName("");
            }
            setNameObject(dfdsName);
        } else
            super.setName(name);
    }
}
Also used : Attribute(com.ramussoft.common.Attribute) DFDSName(com.ramussoft.idef0.attribute.DFDSName) Row(com.ramussoft.pb.Row)

Example 50 with Attribute

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

the class NFunction method setOwner.

public void setOwner(final Row owner) {
    Function ow = null;
    if (getType() == Function.TYPE_DFDS_ROLE) {
        ow = (Function) owner;
        if (ow == null)
            ow = (Function) getOwner();
    }
    if (owner == null) {
        setObject(OWNER_ID, null);
    } else {
        setObject(OWNER_ID, ((NRow) owner).getElementId());
    }
    Function function = (Function) getParent();
    if (function.getDecompositionType() == MovingArea.DIAGRAM_TYPE_DFDS) {
        HashSet<Sector> toUpdate = new HashSet<Sector>();
        if (getType() == Function.TYPE_DFDS_ROLE) {
            if (ow != null) {
                for (Sector sector : function.getSectors()) {
                    if (ow.equals(sector.getStart().getFunction()) || ow.equals(sector.getEnd().getFunction()))
                        if (!toUpdate.contains(sector))
                            toUpdate.add(sector);
                }
            }
        } else {
            for (Sector sector : function.getSectors()) {
                if (this.equals(sector.getStart().getFunction()) || this.equals(sector.getEnd().getFunction()))
                    if (!toUpdate.contains(sector))
                        toUpdate.add(sector);
            }
        }
        for (Sector sector : toUpdate) SectorRefactor.fixOwners(sector, getDataPlugin());
    }
    for (Attribute attribute : engine.getQualifier(getElement().getQualifierId()).getAttributes()) if (attribute.getAttributeType().equals(DFDSNamePlugin.type)) {
        DFDSName dfdsName = (DFDSName) engine.getAttribute(getElement(), attribute);
        if (dfdsName != null)
            dataPlugin.compileDFDSName(dfdsName, this);
    }
}
Also used : Function(com.ramussoft.pb.Function) Attribute(com.ramussoft.common.Attribute) Sector(com.ramussoft.pb.Sector) DFDSName(com.ramussoft.idef0.attribute.DFDSName) HashSet(java.util.HashSet)

Aggregations

Attribute (com.ramussoft.common.Attribute)203 Qualifier (com.ramussoft.common.Qualifier)72 Element (com.ramussoft.common.Element)70 ArrayList (java.util.ArrayList)53 Engine (com.ramussoft.common.Engine)32 List (java.util.List)20 Row (com.ramussoft.database.common.Row)19 Hashtable (java.util.Hashtable)19 SQLException (java.sql.SQLException)16 AttributeType (com.ramussoft.common.AttributeType)15 FindObject (com.ramussoft.common.attribute.FindObject)11 AttributeEvent (com.ramussoft.common.event.AttributeEvent)11 ResultSet (java.sql.ResultSet)11 AttributePlugin (com.ramussoft.gui.common.AttributePlugin)10 AccessRules (com.ramussoft.common.AccessRules)9 Transaction (com.ramussoft.common.persistent.Transaction)9 HierarchicalPersistent (com.ramussoft.core.attribute.simple.HierarchicalPersistent)9 RowMapper (com.ramussoft.jdbc.RowMapper)9 Row (com.ramussoft.pb.Row)9 ImageIcon (javax.swing.ImageIcon)9