javax.swing.JSlider.isEnabled()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(93)

本文整理了Java中javax.swing.JSlider.isEnabled()方法的一些代码示例,展示了JSlider.isEnabled()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSlider.isEnabled()方法的具体详情如下:
包路径:javax.swing.JSlider
类名称:JSlider
方法名:isEnabled

JSlider.isEnabled介绍

暂无

代码示例

代码示例来源:origin: bonnyfone/vectalign

@Override
  public void stateChanged(ChangeEvent e) {
    if(sliderMorphing.isEnabled()){
      svgMorphing.renderStep(((float)sliderMorphing.getValue())/1000.f);
    }
  }
});

代码示例来源:origin: com.synaptix/SynaptixSwing

public boolean isEnabled() {
  boolean b = true;
  if (slider != null) {
    b = slider.isEnabled();
  }
  return b;
}

代码示例来源:origin: com.synaptix/SynaptixSwing

public boolean isEnabled() {
  boolean b = true;
  if (slider != null) {
    b = slider.isEnabled();
  }
  return b;
}

代码示例来源:origin: com.jidesoft/jide-oss

apple.laf.JRSUIConstants.State getState() {
  if (!slider.isEnabled())
    return apple.laf.JRSUIConstants.State.DISABLED;
  if (fIsDragging)
    return apple.laf.JRSUIConstants.State.PRESSED;
  if (!isActive(slider))
    return apple.laf.JRSUIConstants.State.INACTIVE;
  else
    return apple.laf.JRSUIConstants.State.ACTIVE;
}

代码示例来源:origin: org.java.net.substance/substance

public void propertyChange(PropertyChangeEvent evt) {
    if ("enabled".equals(evt.getPropertyName())) {
      thumbModel.setEnabled(slider.isEnabled());
    }
    if ("font".equals(evt.getPropertyName())) {
      SwingUtilities.invokeLater(new Runnable() {
        public void run() {
          slider.updateUI();
        }
      });
    }
  }
};

代码示例来源:origin: org.java.net.substance/substance

public void propertyChange(PropertyChangeEvent evt) {
    if ("enabled".equals(evt.getPropertyName())) {
      SubstanceSliderUI.this.thumbModel.setEnabled(slider
          .isEnabled());
    }
    if ("font".equals(evt.getPropertyName())) {
      SwingUtilities.invokeLater(new Runnable() {
        public void run() {
          slider.updateUI();
        }
      });
    }
  }
};

代码示例来源:origin: com.jtattoo/JTattoo

public void mouseMoved(MouseEvent e) {
  super.mouseMoved(e);
  if (slider.isEnabled()) {
    boolean rollover = thumbRect.contains(e.getPoint());
    if (rollover != isRollover) {
      isRollover = rollover;
      slider.repaint();
    }
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

protected void paintMinorTickForHorizSlider(Graphics g,
                             Rectangle tickBounds, int x)
{
  g.setColor(slider.isEnabled() ? slider.getForeground()
                      : TonicLookAndFeel.getControlShadow());
  g.drawLine(x, TICK_BUFFER, x, TICK_BUFFER+(tickLength/2));
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

protected void paintMajorTickForHorizSlider(Graphics g,
                             Rectangle tickBounds, int x)
{
  g.setColor(slider.isEnabled() ? slider.getForeground()
                      : TonicLookAndFeel.getControlShadow());
  g.drawLine(x, TICK_BUFFER, x, TICK_BUFFER+(tickLength-1));
}

代码示例来源:origin: com.jtattoo/JTattoo

public void mouseEntered(MouseEvent e) {
  super.mouseEntered(e);
  if (slider.isEnabled()) {
    isRollover = thumbRect.contains(e.getPoint());
    slider.repaint();
  }
}

代码示例来源:origin: khuxtable/seaglass

private void setTickColor(Graphics g) {
  if (this.slider.isEnabled() == false) {
    g.setColor(SeaGlassGraphicsUtils.disable(
      DefaultLookup.getColor(slider, this, "Slider.tickColor", Color.black)));
  }
}

代码示例来源:origin: com.jtattoo/JTattoo

public void mouseExited(MouseEvent e) {
  super.mouseExited(e);
  if (slider.isEnabled()) {
    isRollover = false;
    slider.repaint();
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

protected void paintMajorTickForVertSlider(Graphics g, Rectangle tickBounds,
                             int y)
{
  g.setColor(slider.isEnabled() ? slider.getForeground()
                      : TonicLookAndFeel.getControlShadow());
  if(TonicUtils.isLeftToRight(slider))
  {
    g.drawLine(TICK_BUFFER, y, TICK_BUFFER+tickLength, y);
  }
  else
  {
    g.drawLine(0, y, tickLength, y);
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

protected void paintMinorTickForVertSlider(Graphics g, Rectangle tickBounds,
                             int y)
{
  g.setColor(slider.isEnabled() ? slider.getForeground()
                      : TonicLookAndFeel.getControlShadow());
  if(TonicUtils.isLeftToRight(slider))
  {
    g.drawLine(TICK_BUFFER, y, TICK_BUFFER+(tickLength/2), y);
  }
  else
  {
    g.drawLine(0, y, tickLength/2, y);
  }
}

代码示例来源:origin: org.gephi/ui-components

@Override
public void mouseDragged(MouseEvent e) {
  if (!slider.isEnabled()) {
    return;
  }
  currentMouseX = e.getX();
  currentMouseY = e.getY();
  if (lowerDragging) {
    slider.setValueIsAdjusting(true);
    moveLowerThumb();
  } else if (upperDragging) {
    slider.setValueIsAdjusting(true);
    moveUpperThumb();
  }
}

代码示例来源:origin: org.gephi/ui-components

@Override
public void mouseDragged(MouseEvent e) {
  if (!slider.isEnabled()) {
    return;
  }
  currentMouseX = e.getX();
  currentMouseY = e.getY();
  if (lowerDragging) {
    slider.setValueIsAdjusting(true);
    moveLowerThumb();
  } else if (upperDragging) {
    slider.setValueIsAdjusting(true);
    moveUpperThumb();
  }
}

代码示例来源:origin: igvteam/igv

@Override
public void mouseDragged(MouseEvent e) {
  if (!slider.isEnabled()) {
    return;
  }
  currentMouseX = e.getX();
  currentMouseY = e.getY();
  if (lowerDragging) {
    slider.setValueIsAdjusting(true);
    moveLowerThumb();
  } else if (upperDragging) {
    slider.setValueIsAdjusting(true);
    moveUpperThumb();
  }
}

代码示例来源:origin: com.github.insubstantial/substance

/** Creates a new instance. */
@SuppressWarnings("UseOfObsoleteCollectionType")
 public ColorSliderUI(JSlider b) {
   super(b);
   this.thumbModel = new DefaultButtonModel();
   this.thumbModel.setArmed(false);
   this.thumbModel.setSelected(false);
   this.thumbModel.setPressed(false);
   this.thumbModel.setRollover(false);
   this.thumbModel.setEnabled(b.isEnabled());
   this.stateTransitionTracker = new StateTransitionTracker(b,
       this.thumbModel);
 b.setLabelTable(new java.util.Hashtable());
 }

代码示例来源:origin: org.java.net.substance/substance

/** Creates a new instance. */
public ColorSliderUI(JSlider b) {
  super(b);
  this.thumbModel = new DefaultButtonModel();
  this.thumbModel.setArmed(false);
  this.thumbModel.setSelected(false);
  this.thumbModel.setPressed(false);
  this.thumbModel.setRollover(false);
  this.thumbModel.setEnabled(b.isEnabled());
  this.stateTransitionTracker = new StateTransitionTracker(b,
      this.thumbModel);
}

代码示例来源:origin: org.java.net.substance/substance

/**
 * Simple constructor.
 * 
 * @param slider
 *            Slider.
 */
public SubstanceSliderUI(JSlider slider) {
  super(null);
  this.thumbModel = new DefaultButtonModel();
  this.thumbModel.setArmed(false);
  this.thumbModel.setSelected(false);
  this.thumbModel.setPressed(false);
  this.thumbModel.setRollover(false);
  this.thumbModel.setEnabled(slider.isEnabled());
  this.stateTransitionTracker = new StateTransitionTracker(slider,
      this.thumbModel);
}

相关文章

JSlider类方法