Search in sources :

Example 1 with CustomHandles

use of com.cburch.logisim.tools.CustomHandles in project logisim-evolution by reds-heig.

the class Selection method draw.

// 
// graphics methods
// 
public void draw(ComponentDrawContext context, Set<Component> hidden) {
    Graphics g = context.getGraphics();
    for (Component c : lifted) {
        if (!hidden.contains(c)) {
            Location loc = c.getLocation();
            Graphics g_new = g.create();
            context.setGraphics(g_new);
            c.getFactory().drawGhost(context, Color.GRAY, loc.getX(), loc.getY(), c.getAttributeSet());
            g_new.dispose();
        }
    }
    for (Component comp : unionSet) {
        if (!suppressHandles.contains(comp) && !hidden.contains(comp)) {
            Graphics g_new = g.create();
            context.setGraphics(g_new);
            CustomHandles handler = (CustomHandles) comp.getFeature(CustomHandles.class);
            if (handler == null) {
                context.drawHandles(comp);
            } else {
                handler.drawHandles(context);
            }
            g_new.dispose();
        }
    }
    context.setGraphics(g);
}
Also used : Graphics(java.awt.Graphics) CustomHandles(com.cburch.logisim.tools.CustomHandles) Component(com.cburch.logisim.comp.Component) Location(com.cburch.logisim.data.Location)

Aggregations

Component (com.cburch.logisim.comp.Component)1 Location (com.cburch.logisim.data.Location)1 CustomHandles (com.cburch.logisim.tools.CustomHandles)1 Graphics (java.awt.Graphics)1