1 19 24 25 package org.netbeans.swing.tabcontrol.plaf; 26 27 import javax.swing.*; 28 29 37 public abstract class FxProvider { 38 protected JComponent comp; 39 protected JRootPane root; 40 private boolean running = false; 41 protected Object orientation = null; 42 43 public FxProvider() { 44 } 45 46 51 public final void start(JComponent comp, JRootPane root, Object orientation) { 52 if (running) { 53 if (comp == this.comp && root == this.root) { 54 return; 55 } else { 56 abort(); 57 } 58 } 59 this.comp = comp; 60 this.root = root; 61 this.orientation = orientation; 62 running = true; 63 doStart(); 64 } 65 66 78 public final void finish() { 79 running = false; 80 doFinish(); 81 cleanup(); 82 } 83 84 86 public final void abort() { 87 running = false; 88 cleanup(); 89 comp = null; 90 root = null; 91 } 92 93 94 public final boolean isRunning() { 95 return running; 96 } 97 98 99 public abstract void cleanup(); 100 101 104 protected abstract void doStart(); 105 106 108 protected abstract void doFinish(); 109 110 } 111 | Popular Tags |