Skip to content

Commit c6d8156

Browse files
committed
ui tweaks for Petr
1 parent 96965e2 commit c6d8156

File tree

1 file changed

+39
-13
lines changed

1 file changed

+39
-13
lines changed

splat/src/main/uk/ac/starlink/splat/vo/SSAQueryBrowser.java

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
import java.awt.BorderLayout;
1212
import java.awt.Dimension;
13+
import java.awt.GridBagConstraints;
14+
import java.awt.GridBagLayout;
1315
import java.awt.Point;
1416
import java.awt.Rectangle;
1517
import java.awt.event.ActionEvent;
@@ -114,7 +116,7 @@ public class SSAQueryBrowser
114116

115117
/** Initial window size and location */
116118
private static final Rectangle defaultWindowLocation =
117-
new Rectangle( 0, 0, 500, 550 );
119+
new Rectangle( 0, 0, 600, 650 );
118120

119121
/** The object holding the list of servers that we should use for SSA
120122
* queries. */
@@ -370,8 +372,7 @@ private void initFrame()
370372
{
371373
setTitle( Utilities.getTitle( "Query VO for Spectra" ) );
372374
setDefaultCloseOperation( JFrame.HIDE_ON_CLOSE );
373-
setSize( new Dimension( 600, 500 ) );
374-
Utilities.setFrameLocation( this, defaultWindowLocation, prefs,
375+
Utilities.setFrameLocation( this, defaultWindowLocation, prefs,
375376
"SSAQueryBrowser" );
376377
setVisible( true );
377378
}
@@ -408,14 +409,14 @@ private void initQueryComponents()
408409
// RA and Dec fields. We're free-formatting on these (decimal degrees
409410
// not required).
410411
JLabel raLabel = new JLabel( "RA:" );
411-
raField = new JTextField( 15 );
412+
raField = new JTextField( 30 );
412413
layouter.add( raLabel, false );
413414
layouter.add( raField, true );
414415
raField.setToolTipText( "Enter the RA of field centre, " +
415416
"decimal degrees or hh:mm:ss.ss" );
416417

417418
JLabel decLabel = new JLabel( "Dec:" );
418-
decField = new JTextField( 15 );
419+
decField = new JTextField( 30 );
419420
layouter.add( decLabel, false );
420421
layouter.add( decField, true );
421422
decField.setToolTipText( "Enter the Dec of field centre, " +
@@ -434,9 +435,24 @@ private void initQueryComponents()
434435
JLabel bandLabel = new JLabel( "Band:" );
435436
lowerBandField = new JTextField( 15 );
436437
upperBandField = new JTextField( 15 );
438+
439+
JPanel bandPanel = new JPanel( new GridBagLayout() );
440+
GridBagConstraints gbc = new GridBagConstraints();
441+
442+
gbc.weightx = 1.0;
443+
gbc.fill = GridBagConstraints.HORIZONTAL;
444+
bandPanel.add( lowerBandField, gbc );
445+
446+
gbc.weightx = 0.0;
447+
gbc.fill = GridBagConstraints.NONE;
448+
bandPanel.add( new JLabel( "/" ), gbc );
449+
450+
gbc.weightx = 1.0;
451+
gbc.fill = GridBagConstraints.HORIZONTAL;
452+
bandPanel.add( upperBandField, gbc );
453+
437454
layouter.add( bandLabel, false );
438-
layouter.add( lowerBandField, false );
439-
layouter.add( upperBandField, false );
455+
layouter.add( bandPanel, true );
440456
lowerBandField.setToolTipText( "Lower limit, or single include " +
441457
"value, for spectral band, in meters" );
442458
upperBandField.setToolTipText
@@ -446,10 +462,23 @@ private void initQueryComponents()
446462
JLabel timeLabel = new JLabel( "Time:" );
447463
lowerTimeField = new JTextField( 15 );
448464
upperTimeField = new JTextField( 15 );
465+
466+
JPanel timePanel = new JPanel( new GridBagLayout() );
467+
468+
gbc.weightx = 1.0;
469+
gbc.fill = GridBagConstraints.HORIZONTAL;
470+
timePanel.add( lowerTimeField, gbc );
471+
472+
gbc.weightx = 0.0;
473+
gbc.fill = GridBagConstraints.NONE;
474+
timePanel.add( new JLabel( "/" ), gbc );
475+
476+
gbc.weightx = 1.0;
477+
gbc.fill = GridBagConstraints.HORIZONTAL;
478+
timePanel.add( upperTimeField, gbc );
479+
449480
layouter.add( timeLabel, false );
450-
layouter.add( lowerTimeField, false );
451-
layouter.add( upperTimeField, true );
452-
//layouter.eatLine();
481+
layouter.add( timePanel, true );
453482
lowerTimeField.setToolTipText( "Lower limit, or single include " +
454483
"value for time coverage, " +
455484
"ISO 8601 format " +
@@ -458,9 +487,6 @@ private void initQueryComponents()
458487
"in ISO 8601 format " +
459488
"(e.g 2008-10-15T20:48Z)" );
460489

461-
// At Petr Skoda's request. FLUXCALIB and WAVECALIB.
462-
463-
464490
// Do the search.
465491
goButton = new JButton( "Go" );
466492
goButton.addActionListener( this );

0 commit comments

Comments
 (0)