Package com.cburch.logisim.comp

Examples of com.cburch.logisim.comp.ComponentDrawContext


      }

      // 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


      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

            Strings.get("couldNotCreateImage"));
        monitor.close();
      }

      CircuitState circuitState = canvas.getProject().getCircuitState(circuit);
      ComponentDrawContext context = new ComponentDrawContext(canvas,
          circuit, circuitState, base, g, printerView);
      circuit.draw(context, null);

      File where;
      if (dest.isDirectory()) {
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

      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

    public int getIconWidth() {
      return 20;
    }

    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

    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

      this.tool = tool;
    }

    public void paintIcon(Component comp, Graphics g, int x, int y) {
      Graphics gNew = g.create();
      tool.paintIcon(new ComponentDrawContext(comp, null, null, g, gNew), x + 2, y + 2);
      gNew.dispose();
    }
View Full Code Here

  public void paintIcon(java.awt.Component c, Graphics g,
      int x, int y) {
    // draw tool icon
    Graphics gIcon = g.create();
    ComponentDrawContext context = new ComponentDrawContext(c, null, null, g, gIcon);
    comp.getFactory().paintIcon(context, x, y, comp.getAttributeSet());
    gIcon.dispose();
   
    if (triangleState != TRIANGLE_NONE) {
      int[] xp;
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.