Package com.cburch.draw.tools

Examples of com.cburch.draw.tools.AbstractTool


  }
 
  @Override
  public boolean isSelected(ToolbarItem item) {
    if (item instanceof ToolbarToolItem) {
      AbstractTool tool = ((ToolbarToolItem) item).getTool();
      return canvas != null && tool == canvas.getTool();
    } else {
      return false;
    }
  }
View Full Code Here


  }

  @Override
  public void itemSelected(ToolbarItem item) {
    if (item instanceof ToolbarToolItem) {
      AbstractTool tool = ((ToolbarToolItem) item).getTool();
      canvas.setTool(tool);
      fireToolbarAppearanceChanged();
    }
  }
View Full Code Here

    for(int i = 0; i < tools.length; i++) {
      AbstractTool[] column = tools[i];
      int x = ICON_SEP + i * (ICON_SEP + ICON_WIDTH);
      int y = ICON_SEP;
      for(int j = 0; j < column.length; j++) {
        AbstractTool tool = column[j];
        if (tool == listener.toolPressed && listener.inTool) {
          g.setColor(Color.darkGray);
          g.fillRect(x, y, ICON_WIDTH, ICON_HEIGHT);
        }
        Icon icon = tool.getIcon();
        if (icon != null) icon.paintIcon(this, g, x, y);
        if (tool == current) {
          GraphicsUtil.switchToWidth(g, 2);
          g.setColor(Color.black);
          g.drawRect(x - 1, y - 1, ICON_WIDTH + 2, ICON_HEIGHT + 2);
View Full Code Here

        for(int i = 0; i < tools.length; i++) {
            AbstractTool[] column = tools[i];
            int x = ICON_SEP + i * (ICON_SEP + ICON_WIDTH);
            int y = ICON_SEP;
            for(int j = 0; j < column.length; j++) {
                AbstractTool tool = column[j];
                if (tool == listener.toolPressed && listener.inTool) {
                    g.setColor(Color.darkGray);
                    g.fillRect(x, y, ICON_WIDTH, ICON_HEIGHT);
                }
                Icon icon = tool.getIcon();
                if (icon != null) {
                    icon.paintIcon(this, g, x, y);
                }

                if (tool.equals(current)) {
                    GraphicsUtil.switchToWidth(g, 2);
                    g.setColor(Color.black);
                    g.drawRect(x - 1, y - 1, ICON_WIDTH + 2, ICON_HEIGHT + 2);
                }
                y += ICON_HEIGHT + ICON_SEP;
View Full Code Here

    }

    @Override
    public boolean isSelected(ToolbarItem item) {
        if (item instanceof ToolbarToolItem) {
            AbstractTool tool = ((ToolbarToolItem) item).getTool();
            return canvas != null && tool == canvas.getTool();
        } else {
            return false;
        }
    }
View Full Code Here

    }

    @Override
    public void itemSelected(ToolbarItem item) {
        if (item instanceof ToolbarToolItem) {
            AbstractTool tool = ((ToolbarToolItem) item).getTool();
            canvas.setTool(tool);
            fireToolbarAppearanceChanged();
        }
    }
View Full Code Here

TOP

Related Classes of com.cburch.draw.tools.AbstractTool

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.