doPreSelection(_lonBox, "lon"); doPreSelection(_latBox, "lat"); _radiusSpinner = UIUtils.createSpinner(_defaultRadius, _minRadius, _maxRadius, _smallRadiusStep, _bigRadiusStep, "#0"); _validMaskField = new JTextField(createDefaultValidMask(_product));
private JPanel createGeoCoordinatesPane() { JPanel geoCoordinatesPane = GridBagUtils.createPanel(); setComponentName(geoCoordinatesPane, "geoCoordinatesPane"); GridBagConstraints gbc = GridBagUtils.createConstraints( "insets.left=3,anchor=WEST,fill=HORIZONTAL, weightx=1.0"); GridBagUtils.setAttributes(gbc, "insets.top=4"); GridBagUtils.addToPanel(geoCoordinatesPane, new JLabel("North latitude bound:"), gbc, "gridx=0,gridy=0"); GridBagUtils.addToPanel(geoCoordinatesPane, UIUtils.createSpinner(paramNorthLat1, (double) 1, "#0.00#"), gbc, "gridx=1,gridy=0"); GridBagUtils.setAttributes(gbc, "insets.top=1"); GridBagUtils.addToPanel(geoCoordinatesPane, new JLabel("West longitude bound:"), gbc, "gridx=0,gridy=1"); GridBagUtils.addToPanel(geoCoordinatesPane, UIUtils.createSpinner(paramWestLon1, (double) 1, "#0.00#"), gbc, "gridx=1,gridy=1"); GridBagUtils.setAttributes(gbc, "insets.top=4"); GridBagUtils.addToPanel(geoCoordinatesPane, new JLabel("South latitude bound:"), gbc, "gridx=0,gridy=2"); GridBagUtils.addToPanel(geoCoordinatesPane, UIUtils.createSpinner(paramSouthLat2, (double) 1, "#0.00#"), gbc, "gridx=1,gridy=2"); GridBagUtils.setAttributes(gbc, "insets.top=1"); GridBagUtils.addToPanel(geoCoordinatesPane, new JLabel("East longitude bound:"), gbc, "gridx=0,gridy=3"); GridBagUtils.addToPanel(geoCoordinatesPane, UIUtils.createSpinner(paramEastLon2, (double) 1, "#0.00#"), gbc, "gridx=1,gridy=3"); return geoCoordinatesPane; }
private JPanel createPixelCoordinatesPane() { GridBagConstraints gbc = GridBagUtils.createConstraints( "insets.left=3,anchor=WEST,fill=HORIZONTAL, weightx=1.0"); JPanel pixelCoordinatesPane = GridBagUtils.createPanel(); setComponentName(pixelCoordinatesPane, "pixelCoordinatesPane"); GridBagUtils.setAttributes(gbc, "insets.top=4"); GridBagUtils.addToPanel(pixelCoordinatesPane, new JLabel("Scene start X:"), gbc, "gridx=0,gridy=0"); GridBagUtils.addToPanel(pixelCoordinatesPane, UIUtils.createSpinner(paramX1, 25, "#0"), gbc, "gridx=1,gridy=0"); GridBagUtils.setAttributes(gbc, "insets.top=1"); GridBagUtils.addToPanel(pixelCoordinatesPane, new JLabel("Scene start Y:"), gbc, "gridx=0,gridy=1"); GridBagUtils.addToPanel(pixelCoordinatesPane, UIUtils.createSpinner(paramY1, 25, "#0"), gbc, "gridx=1,gridy=1"); GridBagUtils.setAttributes(gbc, "insets.top=4"); GridBagUtils.addToPanel(pixelCoordinatesPane, new JLabel("Scene end X:"), gbc, "gridx=0,gridy=2"); GridBagUtils.addToPanel(pixelCoordinatesPane, UIUtils.createSpinner(paramX2, 25, "#0"), gbc, "gridx=1,gridy=2"); GridBagUtils.setAttributes(gbc, "insets.top=1"); GridBagUtils.addToPanel(pixelCoordinatesPane, new JLabel("Scene end Y:"), gbc, "gridx=0,gridy=3"); GridBagUtils.addToPanel(pixelCoordinatesPane, UIUtils.createSpinner(paramY2, 25, "#0"), gbc, "gridx=1,gridy=3"); return pixelCoordinatesPane; }
@Test public void testCreateSpinner_WithParameter() { final String labelname = "paramLabel"; final ParamProperties properties = new ParamProperties(Integer.class, Integer.valueOf(3)); properties.setLabel(labelname); final Parameter parameter = new Parameter("paramName", properties); final JSpinner spinner = UIUtils.createSpinner(parameter, Integer.valueOf(10), "#0"); assertEquals(labelname, spinner.getName()); }
GridBagUtils.addToPanel(textInputPane, UIUtils.createSpinner(paramSX, 1, "#0"), gbc, "gridx=1,gridy=1"); GridBagUtils.setAttributes(gbc, "insets.top=1"); GridBagUtils.addToPanel(textInputPane, new JLabel("Scene step Y:"), gbc, "gridx=0,gridy=2"); GridBagUtils.addToPanel(textInputPane, UIUtils.createSpinner(paramSY, 1, "#0"), gbc, "gridx=1,gridy=2");
final Comparable max = (Comparable) properties.getMaxValue(); final Double bigStep = spinnerStep.doubleValue() * 10; final JSpinner spinner = createSpinner(v, min, max, spinnerStep, bigStep, formatPattern); spinner.setName(properties.getLabel()); spinner.addChangeListener(new ChangeListener() {