17 package com.generalrobotix.ui.util;
19 import java.awt.BorderLayout;
20 import java.awt.Component;
21 import java.awt.event.ActionEvent;
22 import java.awt.event.ActionListener;
24 import javax.swing.JPanel;
25 import javax.swing.JTextField;
32 @SuppressWarnings(
"serial")
50 text_ =
new JTextField();
51 text_.addActionListener(
52 new ActionListener() {
53 public void actionPerformed(ActionEvent e) {
54 setValue(text_.getText());
59 setLayout(
new BorderLayout());
60 add(BorderLayout.CENTER,text_);
61 add(BorderLayout.EAST,spin);
63 setValue((max+min)/2);
67 setValue(text_.getText());
73 setValue(text_.getText());
79 setValue(text_.getText());
87 }
catch (Exception e) {
105 public boolean isOk(
double v) {
106 return (min_ <= v && v<=max_);
110 super.setEnabled(flag);
111 Component[] cmps = getComponents();
112 for (
int i = 0;
i < cmps.length;
i++) {
113 cmps[
i].setEnabled(flag);
void setItem(GrxBaseItem item, String key)
#define null
our own NULL pointer
static int min(int a, int b)
void setEnabled(boolean flag)
void setValue(Object value)
final void setDbl(String key, double value)
associate double value to key
Object setProperty(String key, String value)
set property value associated with a keyword
ItemPropertyDoubleSpin(double min, double max, double step)
png_infop png_uint_32 flag
static int max(int a, int b)