本文整理了Java中javax.swing.JSlider.getMinimum()
方法的一些代码示例,展示了JSlider.getMinimum()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSlider.getMinimum()
方法的具体详情如下:
包路径:javax.swing.JSlider
类名称:JSlider
方法名:getMinimum
暂无
代码示例来源:origin: openpnp/openpnp
@Override
public void actionPerformed(ActionEvent arg0) {
sliderIncrements.setValue(
Math.max(sliderIncrements.getMinimum(), sliderIncrements.getValue() - 1));
}
};
代码示例来源:origin: org.ihtsdo/wb-api
private int getFineControlMin() {
if (this.coarseControl.getValue() > this.coarseControl.getMaximum() - fineControlSize / 2) {
return this.coarseControl.getMaximum() - fineControlSize;
}
if (this.coarseControl.getValue() < this.coarseControl.getMinimum() + fineControlSize / 2) {
return this.coarseControl.getMinimum();
}
return this.coarseControl.getValue() - fineControlSize / 2;
}
代码示例来源:origin: org.diirt/datasource-sample
private void setIndicator(Double value) {
int range = indicator.getMaximum() - indicator.getMinimum();
int position = range / 2;
if (value != null) {
position = (int) (range * value);
}
indicator.setValue(position);
}
代码示例来源:origin: com.hazelcast.simulator/visualizer
@Override
public void mousePressed(MouseEvent e) {
Point p = e.getPoint();
double percent = p.x / ((double) panel.getWidth());
int range = slider.getMaximum() - slider.getMinimum();
double newVal = range * percent;
int result = (int) (slider.getMinimum() + newVal);
slider.setValue(result);
}
});
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
/**
* Set the point size for the plots
*
* @param pointSize the point size to use
*/
public void setPointSize(int pointSize) {
if (pointSize <= m_pointSize.getMaximum()
&& pointSize > m_pointSize.getMinimum()) {
m_pointSize.setValue(pointSize);
}
}
代码示例来源:origin: com.hazelcast.simulator/visualiser
@Override
public void mousePressed(MouseEvent e) {
Point p = e.getPoint();
double percent = p.x / ((double) panel.getWidth());
int range = slider.getMaximum() - slider.getMinimum();
double newVal = range * percent;
int result = (int) (slider.getMinimum() + newVal);
slider.setValue(result);
}
});
代码示例来源:origin: Waikato/weka-trunk
/**
* Set the point size for the plots
*
* @param pointSize the point size to use
*/
public void setPointSize(int pointSize) {
if (pointSize <= m_pointSize.getMaximum()
&& pointSize > m_pointSize.getMinimum()) {
m_pointSize.setValue(pointSize);
}
}
代码示例来源:origin: org.ihtsdo/wb-api
private int getFineControlMax() {
if (this.coarseControl.getValue() > this.coarseControl.getMaximum() - fineControlSize / 2) {
return this.coarseControl.getMaximum();
}
if (this.coarseControl.getValue() < this.coarseControl.getMinimum() + fineControlSize / 2) {
return this.coarseControl.getMinimum() + fineControlSize;
}
return this.coarseControl.getValue() + fineControlSize / 2;
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
/**
* Set the plot size
*
* @param plotSize the plot size to use
*/
public void setPlotSize(int plotSize) {
if (plotSize >= m_plotSize.getMinimum()
&& plotSize <= m_plotSize.getMaximum()) {
m_plotSize.setValue(plotSize);
}
}
代码示例来源:origin: abbot/abbot
/** Slide the knob to its minimum. */
public void actionSlideMinimum(Component c) {
actionSlide(c, ((JSlider)c).getMinimum());
}
}
代码示例来源:origin: senbox-org/snap-desktop
private void configureSilderLabels(JSlider recordSlider) {
Hashtable<Integer, JLabel> labelTable = new Hashtable<>();
JLabel minLabel = new JLabel(String.valueOf(recordSlider.getMinimum()));
labelTable.put(recordSlider.getMinimum(), minLabel);
JLabel maxLabel = new JLabel(String.valueOf(recordSlider.getMaximum()));
labelTable.put(recordSlider.getMaximum(), maxLabel);
recordSlider.setLabelTable(labelTable);
}
代码示例来源:origin: pvto/konte-art
public void mouseClicked(MouseEvent e)
{
if (e.getButton() == MouseEvent.BUTTON1)
{
int val = jSlider1.getValue();
int add =
(e.getX() > jSlider1.getWidth() * (val - jSlider1.getMinimum()) / (jSlider1.getMaximum() - jSlider1.getMinimum()) ? 1 : -1);
addToSlider(add);
}
}
});
代码示例来源:origin: joel-costigliola/assertj-swing
@RunsInCurrentThread
private static void checkValueInBounds(@Nonnull JSlider slider, int value) {
int min = slider.getMinimum();
int max = slider.getMaximum();
if (value >= min && value <= max) {
return;
}
String msg = String.format("Value <%d> is not within the JSlider bounds of <%d> and <%d>", value, min, max);
throw new IllegalArgumentException(msg);
}
代码示例来源:origin: cmu-phil/tetrad
private double getValueFromSlider(double c1, double c2) {
int n = this.slider.getMaximum() - this.slider.getMinimum();
int slider = this.slider.getValue();
if (c1 == Double.NEGATIVE_INFINITY && slider == 0) {
return Double.NEGATIVE_INFINITY;
}
if (c2 == Double.POSITIVE_INFINITY && slider == 100) {
return Double.POSITIVE_INFINITY;
}
return sliderToValue(slider, c1, c2, n);
}
代码示例来源:origin: cmu-phil/tetrad
private void setSliderToValue(double value, double c1, double c2) {
if (value == Double.NEGATIVE_INFINITY) {
value = Double.MIN_VALUE;
}
else if (value == Double.POSITIVE_INFINITY) {
value = Double.MAX_VALUE;
}
int n = this.slider.getMaximum() - this.slider.getMinimum();
double x;
int slider = valueToSlider(value, c1, c2, n);
this.slider.setValue(slider);
}
代码示例来源:origin: joel-costigliola/assertj-swing
@Override
protected Pair<Integer, GenericRange<Point>> executeInEDT() {
checkEnabledAndShowing(slider);
int value = slider.getMinimum();
GenericRange<Point> fromAndTo = slideInfo(slider, location, value);
return Pair.of(value, fromAndTo);
}
});
代码示例来源:origin: com.hazelcast.simulator/visualizer
@Override
public void mousePressed(MouseEvent e) {
Point p = e.getPoint();
double percent = p.y / ((double) panel.getHeight());
int range = slider.getMaximum() - slider.getMinimum();
double newVal = range * percent;
int result = (int) (slider.getMaximum() - newVal);
slider.setValue(result);
}
});
代码示例来源:origin: abbot/abbot
/** Click at the minimum end of the slider. */
public void actionDecrement(Component c) {
JSlider s = (JSlider)c;
actionClick(c, valueToLocation(s, s.getMinimum()));
}
代码示例来源:origin: com.hazelcast.simulator/visualiser
@Override
public void mousePressed(MouseEvent e) {
Point p = e.getPoint();
double percent = p.y / ((double) panel.getHeight());
int range = slider.getMaximum() - slider.getMinimum();
double newVal = range * percent;
int result = (int) (slider.getMaximum() - newVal);
slider.setValue(result);
}
});
代码示例来源:origin: tulskiy/musique
private void showToolTip(MouseEvent e) {
Track s = player.getTrack();
if (s != null) {
toolTip.setTipText(Util.samplesToTime(progressSlider.getValue() - progressSlider.getMinimum(), s.getTrackData().getSampleRate(), 1));
int x = e.getXOnScreen();
x = Math.max(x, progressSlider.getLocationOnScreen().x);
x = Math.min(x, progressSlider.getLocationOnScreen().x + progressSlider.getWidth() - toolTip.getWidth());
popup = popupFactory.getPopup(progressSlider, toolTip, x, progressSlider.getLocationOnScreen().y + 25);
popup.show();
}
}
内容来源于网络,如有侵权,请联系作者删除!