Package com.cburch.logisim.data

Examples of com.cburch.logisim.data.AttributeSet


        if (ret != null || sourceLoadAttempted) {
            return ret;
        } else {
            ret = description.getFactory(descriptionBase);
            if (ret != null) {
                AttributeSet base = getBaseAttributes();
                Boolean value = (Boolean) ret.getFeature(ComponentFactory.SHOULD_SNAP, base);
                shouldSnap = value == null ? true : value.booleanValue();
            }
            factory = ret;
            sourceLoadAttempted = true;
View Full Code Here


            dx = Canvas.snapXToGrid(dx);
            dy = Canvas.snapYToGrid(dy);
        }
        Graphics g = context.getGraphics();
        for (Component comp : unionSet) {
            AttributeSet attrs = comp.getAttributeSet();
            Location loc = comp.getLocation();
            int x = loc.getX() + dx;
            int y = loc.getY() + dy;
            context.setGraphics(g.create());
            comp.getFactory().drawGhost(context, Color.gray, x, y, attrs);
View Full Code Here

            source.drawGhost(context, Color.BLACK, x, y, getBaseAttributes());
        }
    }

    private AttributeSet getBaseAttributes() {
        AttributeSet ret = attrs;
        if (ret instanceof FactoryAttributes) {
            ret = ((FactoryAttributes) ret).getBase();
        }
        return ret;
    }
View Full Code Here

            }

            moveTo(canvas, g, e.getX(), e.getY());

            Location loc = Location.create(e.getX(), e.getY());
            AttributeSet attrsCopy = (AttributeSet) attrs.clone();
            ComponentFactory source = getFactory();
            if (source == null) {
                return;
            }
View Full Code Here

    private void processKeyEvent(Canvas canvas, KeyEvent event, int type) {
        KeyConfigurator handler = keyHandler;
        if (!keyHandlerTried) {
            ComponentFactory source = getFactory();
            AttributeSet baseAttrs = getBaseAttributes();
            handler = (KeyConfigurator) source.getFeature(KeyConfigurator.class, baseAttrs);
            keyHandler = handler;
            keyHandlerTried = true;
        }

        if (handler != null) {
            AttributeSet baseAttrs = getBaseAttributes();
            KeyConfigurationEvent e = new KeyConfigurationEvent(type, baseAttrs, event, this);
            KeyConfigurationResult r = handler.keyEventReceived(e);
            if (r != null) {
                Action act = ToolAttributeAction.create(r);
                canvas.getProject().doAction(act);
View Full Code Here

        ComponentFactory source = getFactory();
        if (source == null) {
            return;
        }

        AttributeSet base = getBaseAttributes();
        Object feature = source.getFeature(ComponentFactory.FACING_ATTRIBUTE_KEY, base);
        @SuppressWarnings("unchecked")
        Attribute<Direction> attr = (Attribute<Direction>) feature;
        if (attr != null) {
            Action act = ToolAttributeAction.create(this, attr, facing);
View Full Code Here

            }
        }

        ComponentFactory source = getFactory();
        if (source != null) {
            AttributeSet base = getBaseAttributes();
            source.paintIcon(c, x, y, base);
        }
    }
View Full Code Here

        if (ret == null) {
            ComponentFactory source = getFactory();
            if (source == null) {
                ret = Bounds.EMPTY_BOUNDS;
            } else {
                AttributeSet base = getBaseAttributes();
                ret = source.getOffsetBounds(base).expand(5);
            }
            bounds = ret;
        }
        return ret;
View Full Code Here

        @Override
        public void attributeListChanged(AttributeEvent e) { }

        @Override
        public void attributeValueChanged(AttributeEvent e) {
            AttributeSet attrs = e.getSource();
            BitWidth addrBits = attrs.getValue(Mem.ADDR_ATTR);
            BitWidth dataBits = attrs.getValue(Mem.DATA_ATTR);
            getContents().setDimensions(addrBits.getWidth(), dataBits.getWidth());
        }
View Full Code Here

        add(simLimitPanel);
        add(gateUndefinedPanel);
        add(simRandomness);

        window.getOptions().getAttributeSet().addAttributeListener(myListener);
        AttributeSet attrs = getOptions().getAttributeSet();
        myListener.loadSimLimit(attrs.getValue(Options.sim_limit_attr));
        myListener.loadGateUndefined(attrs.getValue(Options.ATTR_GATE_UNDEFINED));
        myListener.loadSimRandomness(attrs.getValue(Options.sim_rand_attr));
    }
View Full Code Here

TOP

Related Classes of com.cburch.logisim.data.AttributeSet

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.