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

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

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

JSlider.repaint介绍

暂无

代码示例

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

private void setThumbPressed(boolean pressed) {
  if (thumbPressed != pressed) {
    thumbPressed = pressed;
    slider.repaint(thumbRect);
  }
}

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

private void setThumbActive(boolean active) {
  if (thumbActive != active) {
    thumbActive = active;
    slider.repaint(thumbRect);
  }
}

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

/**
 * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
 */
@Override
public void mouseEntered(MouseEvent e) {
  hover = true;
  slider.repaint();
}

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

/**
   * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
   */
  @Override
  public void mouseExited(MouseEvent e) {
    hover = false;
    slider.repaint();
    setCursor(Cursor.DEFAULT_CURSOR);
  }
}

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

/**
   * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
   */
  @Override
  public void mouseExited(MouseEvent e) {
    hover = false;
    slider.repaint();
    setCursor(Cursor.DEFAULT_CURSOR);
  }
}

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

/**
   * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
   */
  @Override
  public void mouseExited(MouseEvent e) {
    hover = false;
    slider.repaint();
    setCursor(Cursor.DEFAULT_CURSOR);
  }
}

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

public void stateChanged(ChangeEvent arg0) {
    if (!lowerDragging && !upperDragging) {
      calculateThumbLocation();
      slider.repaint();
    }
  }
}

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

/**
   * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
   */
  @Override
  public void mouseExited(MouseEvent e) {
    hover = false;
    slider.repaint();
    setCursor(Cursor.DEFAULT_CURSOR);
  }
}

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

@Override
  public void stateChanged(ChangeEvent arg0) {
    if (!lowerDragging && !upperDragging) {
      calculateThumbLocation();
      slider.repaint();
    }
  }
}

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

public void stateChanged(ChangeEvent e) {
  if (!isDragging) {
    calculateThumbLocation();
    slider.repaint();
  }
}

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

public void stateChanged(ChangeEvent e) {
  if (!isDragging) {
    calculateThumbLocation();
    slider.repaint();
  }
}

代码示例来源:origin: matsim-org/matsim

void replaceLabel(String label, int newEnd) {
  for (Integer i : labelTable.keySet() ) {
    JLabel value = labelTable.get(i);
    if(value.getText().equals(label)) {
      labelTable.remove(i);
      break;
    }
  }
  labelTable.put(Integer.valueOf(newEnd), new JLabel(label));
  timestepSlider.setLabelTable(labelTable);
  timestepSlider.repaint();
}

代码示例来源: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: com.jtattoo/JTattoo

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

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

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

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

public void setThumbLocation(int x, int y) {
  super.setThumbLocation(x, y);
  // Value rect is tied to the thumb location. We need to repaint when
  // the thumb repaints.
  slider.repaint(valueRect.x, valueRect.y, valueRect.width, valueRect.height);
  setThumbActive(false);
}

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

public void setThumbLocation(int x, int y) {
  unionRect.setBounds(thumbRect);
  thumbRect.setLocation(x, y);
  SwingUtilities.computeUnion(thumbRect.x, thumbRect.y, thumbRect.width,
      thumbRect.height, unionRect);
  slider.repaint(unionRect.x, unionRect.y, unionRect.width,
      unionRect.height);
}

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

/**
 * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
 */
@Override
public void mouseClicked(MouseEvent e) {
  if (e.getClickCount() == 2) {
    slider.getModel().setValue(slider.getModel().getMinimum());
    slider.getModel().setExtent(slider.getModel().getMaximum() - slider.getModel().getMinimum());
    slider.repaint();
  }
}

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

/**
 * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
 */
@Override
public void mouseClicked(MouseEvent e) {
  if (e.getClickCount() == 2) {
    slider.getModel().setValue(slider.getModel().getMinimum());
    slider.getModel().setExtent(slider.getModel().getMaximum() - slider.getModel().getMinimum());
    slider.repaint();
  }
}

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

/**
 * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
 */
@Override
public void mouseClicked(MouseEvent e) {
  if (e.getClickCount() == 2) {
    slider.getModel().setValue(slider.getModel().getMinimum());
    slider.getModel().setExtent(slider.getModel().getMaximum() - slider.getModel().getMinimum());
    slider.repaint();
  }
}

相关文章

JSlider类方法