FileDocCategorySizeDatePackage
JogShuttle.javaAPI DocExample3593Sun Jan 25 13:39:22 GMT 2004None

JogShuttle

public class JogShuttle extends JComponent implements ChangeListener

Fields Summary
private BoundedRangeModel
model
private Insets
dialInsets
private int
valuePerRevolution
Constructors Summary
public JogShuttle()


    //  Constructors
      
        init(new DefaultBoundedRangeModel());
    
public JogShuttle(BoundedRangeModel m)

        init(m);
    
public JogShuttle(int min, int max, int value)

        init(new DefaultBoundedRangeModel(value, 1, min, max));
    
Methods Summary
public java.awt.InsetsgetDialInsets()

return dialInsets;
public intgetMaximum()

return model.getMaximum();
public intgetMinimum()

return model.getMinimum();
public javax.swing.BoundedRangeModelgetModel()

        return model;
    
public java.lang.StringgetUIClassID()

        return JogShuttleUI.UI_CLASS_ID;
    
public intgetValue()

return model.getValue();
public intgetValuePerRevolution()

return valuePerRevolution;
protected voidinit(javax.swing.BoundedRangeModel m)

        setModel(m);
        valuePerRevolution = m.getMaximum() - m.getMinimum();
        setMinimumSize(new Dimension(80, 80));
        setPreferredSize(new Dimension(80, 80));
        updateUI();
    
public voidresetToMaximum()

model.setValue(model.getMaximum());
public voidresetToMinimum()

model.setValue(model.getMinimum());
public voidsetDialInsets(java.awt.Insets i)

dialInsets = i;
public voidsetDialInsets(int top, int left, int bottom, int right)

        dialInsets = new Insets(top, left, bottom, right);
    
public voidsetMaximum(int m)

        int old = getMaximum();
        if (m != old) {
            model.setMaximum(m);
            firePropertyChange("maximum", old, m);
        }
    
public voidsetMinimum(int m)

        int old = getMinimum();
        if (m != old) {
            model.setMinimum(m);
            firePropertyChange("minimum", old, m);
        }
    
public voidsetModel(javax.swing.BoundedRangeModel m)

        BoundedRangeModel old = model;
        if (old != null)
            old.removeChangeListener(this);

        if (m == null)
            model = new DefaultBoundedRangeModel();
        else
            model = m;
        model.addChangeListener(this);

        firePropertyChange("model", old, model);
    
public voidsetUI(JogShuttleUI ui)

super.setUI(ui);
public voidsetValue(int v)

        int old = getValue();
        if (v != old) {
            model.setValue(v);
            firePropertyChange("value", old, v);
        }
    
public voidsetValuePerRevolution(int v)

        int old = getValuePerRevolution();
        if (v != old) {
            valuePerRevolution = v;
            firePropertyChange("valuePerRevolution", old, v);
        }
        repaint();
    
public voidstateChanged(javax.swing.event.ChangeEvent e)

repaint();
public voidupdateUI()

       setUI((JogShuttleUI)UIManager.getUI(this));
       invalidate();