/** Factory method to get the canvas singleton object. */ public static Canvas getCanvas() { if (canvasSingleton == null) { canvasSingleton = new Canvas("BlueJ Picture Demo", 500, 300, Color.white); } canvasSingleton.setVisible(true); return canvasSingleton; }
/** Factory method to get the canvas singleton object. */ public static Canvas getCanvas() { if (canvasSingleton == null) { canvasSingleton = new Canvas("BlueJ Shapes Demo", 1400, 600, Color.gray); } canvasSingleton.setVisible(true); return canvasSingleton; }
/** Factory method to get the canvas singleton object. */ public static Canvas getCanvas() { if (canvasSingleton == null) { canvasSingleton = new Canvas(Constants.TITLE, Constants.SIZE, Constants.SIZE, Color.white); } canvasSingleton.setVisible(true); return canvasSingleton; }
/** * Called to change the visibility of the outline. * * @param value true if visible. */ public void setVisible(final boolean value) { if (value != isVisible()) { super.setVisible(value); Container parent = getParent(); if ((parent != null) && (parent.getComponentCount() == 1)) { parent.setVisible(value); } invalidate(); try { for (; parent != null; parent = parent.getParent()) { try { parent.getClass().getMethod("resetToPreferredSizes", null).invoke(parent, null); visibleArgs[0] = new Integer(value ? 10 : 0); parent.getClass().getMethod("setDividerSize", visibleParms).invoke(parent, visibleArgs); break; } catch (final Throwable ignored) { } } } catch (final Throwable ignored) { } djvuBean.recursiveRevalidate(); } }
public static void main(String[] args) { Canvas canvas = new Canvas(); canvas.setTitle("canvas sample"); canvas.setSize(600, 200); canvas.setLocationRelativeTo(null); canvas.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); CanvasData dd = new CanvasData(300); NewPanel p = new NewPanel(dd); canvas.add(p); canvas.setVisible(true); }
private void initCanvas() { canvas = new Canvas(); canvas.setVisible(true); canvas = buffer.enableGLCanvasRenderer(); this.add(canvas); }
public void togglePause() { toggleCursor(); paused = !paused; canvas.setVisible(!canvas.isVisible()); }
public synchronized void setVisible(boolean b) { if (b == isVisible()) return; super.setVisible(b); if (!b) clearlines(); }