Package com.nexirius.framework.datamodel

Examples of com.nexirius.framework.datamodel.DataModel


     *
     * @return
     */
    public DataModelVector getSelectedChildren() {
        DataModelVector ret = new DataModelVector();
        DataModel parentModel = getActModel();

        FWLog.debug("selectedChildren " + selectedChildren);
        FWLog.debug("parentModel " + parentModel.getFieldName());

        if (selectedChildren == null) {
            return ret;
        }

        for (String childName = selectedChildren.firstItem(); childName != null; childName = selectedChildren.nextItem())
        {
            try {
                ret.append(parentModel.getChild(childName));
            } catch (Exception e) {
                //ignore
                e.printStackTrace();
            }
        }
View Full Code Here


        super(field, x, y, w, h);
    }

    public void doLayout(DataViewer parent_viewer) {
        try {
            DataModel parent_model = parent_viewer.getDataModel();
            // look for the associated model
            String resourceKey;

            try {
                DataModel model = parent_model.getChild(getModelFieldName());
                resourceKey = model.getFieldName();
            } catch (Exception ex) {
                resourceKey = getModelFieldName();
            }

            // create the associated label
View Full Code Here

    }

    public void doLayout(DataViewer parent_viewer) {
        // find appropriate layout status and call doLayout on it

        DataModel parentModel = parent_viewer.getDataModel();

        if (!(parentModel instanceof AssistantModel)) {

            throw new RuntimeException("Expecting AssistantModel but have: " + parentModel.getClass().getName() + " field name:" + parentModel.getFieldName());
        }

        AssistantModel assistantModel = (AssistantModel) parentModel;
        DataModel actModel = assistantModel.getActModel();
        String modelName = actModel.getFieldName();

        if (modelName == null) {

            return;
        }
View Full Code Here

     *
     * @param parent_viewer The parent viewer which displays the newly created component on its panel.
     */
    public void doLayout(DataViewer parent_viewer) {
        try {
            DataModel parent_model = parent_viewer.getDataModel();
            // look for the associated model
            DataModelCommand method = parent_model.getMethod(getModelFieldName());

            // create the viewer
            DataViewer viewer = parent_viewer.getFactory().createDefaultEditor(method);

            // create a JComponent from the associated viewer
View Full Code Here

                if (!isSelected) {
                    Color background = null;

                    if (value instanceof DataModel) {
                        DataModel model = (DataModel) value;

                        String c = model.getBackgroundColorId();

                        if (c != null) {
                            background = factory.getClientResource().getColor(c);
                        } else {
                            Object rowModel = table.getModel().getValueAt(row, -1);
View Full Code Here

        return ret;
    }

    public void updateTextLabel(JLabel ret) {
        DataModel childModel = getTreeComponent().getChildModel();
        int columns = childModel.getColumns();

        if (childModel.getColumns() > 0) {
            StringBuffer text = new StringBuffer("<html><table><tr>");
            for (int i = 0; i < columns; ++i) {
                text.append("<td>");
                text.append(getTreeComponent().getChildModel().getLabel(i));
                text.append("</td>");
            }
            text.append("</tr></table></html>");
            ret.setText(text.toString());
        } else if (childModel.getLabel() != null) {
            ret.setText(childModel.getLabel());
        } else {
            ret.setText(childModel.getCaption());
        }

        if (childModel.getIconId() != null) {
            Icon icon = getTreeComponent().getTreeViewer().getFactory().getClientResource().getIcon(childModel.getIconId());

            ret.setIcon(icon);
        }
    }
View Full Code Here

        if (!(model instanceof SimpleModel)) {
            throw new IllegalArgumentException("model must be of type SimpleModel but have: " + model.getClass().getName());
        }

        DataModel dm = (SimpleModel) model;

        if (dm.getFlag(ModelFlag.NOT_EDITABLE)) {

            return new SimpleViewer((SimpleModel) model);
        }

        return new SimpleEditor((SimpleModel) model);
View Full Code Here

            if (t instanceof DataModelTypeMethod) {
                DefaultDataModelCommand meth = new DefaultDataModelCommand(t.getMemberName());

                cl.appendMethod(meth);
            } else {
                DataModel instance = t.newInstance(classes);

                instance.setFieldName(t.getMemberName());

                cl.append(instance);
            }
        }
View Full Code Here

        try {
            DataModelParser p = new DataModelParser();

            DataModelClasses classes = p.parse(src);

            DataModel model = classes.newInstance("TestModel", null);

            System.out.println(model.dragData());

            JFrame frame = new JFrame();

            frame.addWindowListener(new MyWindowListener());
            ClientResource res = new ClientResourceImpl("TestClient");
View Full Code Here

     *
     * @param parent_viewer The parent structure viewer
     */
    public void doLayout(DataViewer parent_viewer) {
        try {
            DataModel parent_model = parent_viewer.getDataModel();
            String resourceID = getModelFieldName();

            // create the label
            JLabel label = new CFJLabel(parent_viewer.getFactory().getClientResource(), resourceID);

View Full Code Here

TOP

Related Classes of com.nexirius.framework.datamodel.DataModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.