Package com.cburch.logisim.comp

Examples of com.cburch.logisim.comp.ComponentDrawContext


        g.setColor(Color.BLACK);
      }

      // draw tool icon
      Graphics gIcon = g.create();
      ComponentDrawContext context = new ComponentDrawContext(ProjectExplorer.this, null, null, g, gIcon);
      tool.paintIcon(context, x, y);
      gIcon.dispose();

      // draw magnifying glass if appropriate
      if (circ == proj.getCurrentCircuit()) {
View Full Code Here


                g.setColor(Color.BLACK);
            }

            // draw tool icon
            Graphics gIcon = g.create();
            ComponentDrawContext context = new ComponentDrawContext(ProjectExplorer.this, null, null, g, gIcon);
            tool.paintIcon(context, x, y);
            gIcon.dispose();

            // draw magnifying glass if appropriate
            if (circ == proj.getCurrentCircuit()) {
View Full Code Here

                    MouseEvent.MOUSE_PRESSED, System.currentTimeMillis(), 0,
                    event.getX(), event.getY(), 1, false);
            boolean isAccepted = poker.init(state, e);
            if (isAccepted) {
                this.state = state;
                this.context = new ComponentDrawContext(event.getCanvas(),
                        event.getCanvas().getCircuit(), circState, null, null);
                mousePressed(e);
                return this;
            } else {
                poker = null;
View Full Code Here

            clip.add(bds.getX() + bds.getWidth(),
                    bds.getY() + bds.getHeight());
            g.setClip(clip);

            // And finally draw the circuit onto the page
            ComponentDrawContext context = new ComponentDrawContext(
                    proj.getFrame().getCanvas(), circ, circState,
                    base, g, printerView);
            Collection<Component> noComps = Collections.emptySet();
            circ.draw(context, noComps);
            g.dispose();
View Full Code Here

            return 20;
        }

        @Override
        public void paintIcon(Component c, Graphics g, int x, int y) {
            ComponentDrawContext context = new ComponentDrawContext(c,
                    null, null, g, g);
            factory.paintIcon(context, x, y, factory.createAttributeSet());

            // draw magnifying glass if appropriate
            if (isCurrentView) {
View Full Code Here

            }

            // draw tool icon
            g.setColor(Color.BLACK);
            Graphics g_copy = g.create();
            ComponentDrawContext c = new ComponentDrawContext(destination,
                    null, null, g, g_copy);
            tool.paintIcon(c, 2, 2);
            g_copy.dispose();
        }
View Full Code Here

            if (scale != 1.0 && g instanceof Graphics2D) {
                ((Graphics2D) gCopy).scale(scale, scale);
            }
            gCopy.translate(-bds.getX(), -bds.getY());

            ComponentDrawContext context = new ComponentDrawContext(this, circuit,
                    circuitState, g, gCopy);
            context.setShowState(false);
            context.setShowColor(false);
            circuit.draw(context, Collections.<Component>emptySet());
            if (ports != null) {
                gCopy.setColor(AppearancePort.COLOR);
                int width = Math.max(4, (int) ((2 / scale) + 0.5));
                GraphicsUtil.switchToWidth(gCopy, width);
View Full Code Here

        drawWithUserState(g, gScaled, proj);
        drawWidthIncompatibilityData(g, gScaled, proj);
        Circuit circ = proj.getCurrentCircuit();

        CircuitState circState = proj.getCircuitState();
        ComponentDrawContext ptContext = new ComponentDrawContext(canvas,
                circ, circState, g, gScaled);
        ptContext.setHighlightedWires(highlightedWires);
        gScaled.setColor(Color.RED);
        circState.drawOscillatingPoints(ptContext);
        gScaled.setColor(Color.BLUE);
        proj.getSimulator().drawStepPoints(ptContext);
        gScaled.dispose();
View Full Code Here

        }

        // draw circuit and selection
        CircuitState circState = proj.getCircuitState();
        boolean printerView = AppPreferences.PRINTER_VIEW.getBoolean();
        ComponentDrawContext context = new ComponentDrawContext(canvas,
                circ, circState, base, g, printerView);
        context.setHighlightedWires(highlightedWires);
        circ.draw(context, hidden);
        sel.draw(context, hidden);

        // draw tool
        Tool tool = dragTool != null ? dragTool : proj.getTool();
        if (tool != null && !canvas.isPopupMenuUp()) {
            Graphics gCopy = g.create();
            context.setGraphics(gCopy);
            tool.draw(canvas, context);
            gCopy.dispose();
        }
    }
View Full Code Here

            getFromLocale("couldNotCreateImage"));
        monitor.close();
      }

      CircuitState circuitState = canvas.getProject().getCircuitState(circuit);
      ComponentDrawContext context = new ComponentDrawContext(canvas,
          circuit, circuitState, base, g, printerView);
      circuit.draw(context, null);
      g.dispose();
    }
View Full Code Here

TOP

Related Classes of com.cburch.logisim.comp.ComponentDrawContext

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.