diff -Nru starjava-topcat-4.7/build.xml starjava-topcat-4.7.1/build.xml --- starjava-topcat-4.7/build.xml 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/build.xml 2020-06-04 17:10:04.000000000 +0000 @@ -84,7 +84,7 @@ - + diff -Nru starjava-topcat-4.7/debian/changelog starjava-topcat-4.7.1/debian/changelog --- starjava-topcat-4.7/debian/changelog 2020-01-20 16:26:42.000000000 +0000 +++ starjava-topcat-4.7.1/debian/changelog 2020-06-26 11:35:42.000000000 +0000 @@ -1,3 +1,13 @@ +starjava-topcat (4.7.1-1) unstable; urgency=low + + * New upstream version 4.7.1. Rediff patches + * Update build dep versions + * Push Standards-Version to 4.5.0. No changes needed. + * Push dh-compat to 13 + * Add Rules-Requires-Root: no to d/control + + -- Ole Streicher Fri, 26 Jun 2020 13:35:42 +0200 + starjava-topcat (4.7-2) unstable; urgency=medium * Remove libxmlrpc3-client-java, build dependency (Closes: #949188) diff -Nru starjava-topcat-4.7/debian/control starjava-topcat-4.7.1/debian/control --- starjava-topcat-4.7/debian/control 2020-01-20 16:25:50.000000000 +0000 +++ starjava-topcat-4.7.1/debian/control 2020-06-26 11:34:57.000000000 +0000 @@ -3,7 +3,7 @@ Uploaders: Ole Streicher Section: java Priority: optional -Build-Depends: ant, debhelper-compat (= 12), dh-exec, javahelper +Build-Depends: ant, debhelper-compat (= 13), dh-exec, javahelper Build-Depends-Indep: ant-optional, default-jdk, default-jdk-doc, @@ -17,17 +17,18 @@ libsaxonhe-java, starlink-datanode-java, starlink-fits-java, - starlink-table-java (>= 3.3.3+2019.07.12~), + starlink-table-java (>= 3.4.1~), starlink-task-java, - starlink-ttools-java (>= 3.2~), + starlink-ttools-java (>= 3.2.1~), starlink-util-java, starlink-vo-java, starlink-votable-java, stilts-doc -Standards-Version: 4.4.1 +Standards-Version: 4.5.0 Vcs-Browser: https://salsa.debian.org/debian-astro-team/starjava-topcat Vcs-Git: https://salsa.debian.org/debian-astro-team/starjava-topcat.git Homepage: http://www.starlink.ac.uk/topcat/ +Rules-Requires-Root: no Package: topcat Architecture: all diff -Nru starjava-topcat-4.7/debian/patches/Clearly-mark-this-version-as-Debian.patch starjava-topcat-4.7.1/debian/patches/Clearly-mark-this-version-as-Debian.patch --- starjava-topcat-4.7/debian/patches/Clearly-mark-this-version-as-Debian.patch 2020-01-20 16:21:21.000000000 +0000 +++ starjava-topcat-4.7.1/debian/patches/Clearly-mark-this-version-as-Debian.patch 2020-06-26 11:31:47.000000000 +0000 @@ -8,7 +8,7 @@ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/build.xml b/build.xml -index c5be189..6aec882 100644 +index e1d0257..9879f7e 100644 --- a/build.xml +++ b/build.xml @@ -491,7 +491,7 @@ @@ -39,10 +39,10 @@ diff --git a/src/docs/sun253.xml b/src/docs/sun253.xml -index 131e818..4687c9a 100644 +index a3daafb..9d0fca3 100644 --- a/src/docs/sun253.xml +++ b/src/docs/sun253.xml -@@ -467,6 +467,10 @@ GNU General Public Licence. Its underlying table processing facilities +@@ -485,6 +485,10 @@ GNU General Public Licence. Its underlying table processing facilities are provided by STIL, the Starlink Tables Infrastructure Library. @@ -53,7 +53,7 @@ -@@ -591,6 +595,38 @@ see documentation of the +@@ -609,6 +613,38 @@ see documentation of the for more details.

diff -Nru starjava-topcat-4.7/debian/patches/Don-t-call-home-for-new-version-by-default.patch starjava-topcat-4.7.1/debian/patches/Don-t-call-home-for-new-version-by-default.patch --- starjava-topcat-4.7/debian/patches/Don-t-call-home-for-new-version-by-default.patch 2020-01-20 16:21:21.000000000 +0000 +++ starjava-topcat-4.7.1/debian/patches/Don-t-call-home-for-new-version-by-default.patch 2020-06-26 11:31:47.000000000 +0000 @@ -7,10 +7,10 @@ 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/uk/ac/starlink/topcat/Driver.java b/src/main/uk/ac/starlink/topcat/Driver.java -index de44aa9..8e2f400 100644 +index e23c93d..7377216 100644 --- a/src/main/uk/ac/starlink/topcat/Driver.java +++ b/src/main/uk/ac/starlink/topcat/Driver.java -@@ -243,7 +243,7 @@ public class Driver { +@@ -242,7 +242,7 @@ public class Driver { boolean internalHub = false; boolean externalHub = false; boolean noHub = false; @@ -19,7 +19,7 @@ boolean useRunning = false; for ( Iterator it = argList.iterator(); it.hasNext(); ) { String arg = it.next(); -@@ -649,7 +649,6 @@ public class Driver { +@@ -648,7 +648,6 @@ public class Driver { .append( p2 + "-exthub run external SAMP/PLASTIC hub" ) .append( p2 + "-noserv don't run any services" + " (PLASTIC or SAMP)" ) diff -Nru starjava-topcat-4.7/debian/patches/Fix-build.xml-for-use-outside-of-starjava.patch starjava-topcat-4.7.1/debian/patches/Fix-build.xml-for-use-outside-of-starjava.patch --- starjava-topcat-4.7/debian/patches/Fix-build.xml-for-use-outside-of-starjava.patch 2020-01-20 16:21:21.000000000 +0000 +++ starjava-topcat-4.7.1/debian/patches/Fix-build.xml-for-use-outside-of-starjava.patch 2020-06-26 11:31:47.000000000 +0000 @@ -21,11 +21,11 @@ * Don't sign the jarfile --- - build.xml | 114 +++++++++++++++++++++++++++++++++++--------------------------- - 1 file changed, 64 insertions(+), 50 deletions(-) + build.xml | 116 +++++++++++++++++++++++++++++++++++--------------------------- + 1 file changed, 65 insertions(+), 51 deletions(-) diff --git a/build.xml b/build.xml -index bb680c9..78297bc 100644 +index 746b41a..4cdd51f 100644 --- a/build.xml +++ b/build.xml @@ -37,12 +37,6 @@ @@ -57,17 +57,19 @@ -@@ -82,8 +76,8 @@ +@@ -82,9 +76,9 @@ !--> - - +- + + - ++ + @@ -122,6 +116,7 @@ diff -Nru starjava-topcat-4.7/debian/patches/Fix-Icon-path-in-jhall.jar.patch starjava-topcat-4.7.1/debian/patches/Fix-Icon-path-in-jhall.jar.patch --- starjava-topcat-4.7/debian/patches/Fix-Icon-path-in-jhall.jar.patch 2020-01-20 16:21:21.000000000 +0000 +++ starjava-topcat-4.7.1/debian/patches/Fix-Icon-path-in-jhall.jar.patch 2020-06-26 11:31:47.000000000 +0000 @@ -7,10 +7,10 @@ 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/uk/ac/starlink/topcat/ResourceIcon.java b/src/main/uk/ac/starlink/topcat/ResourceIcon.java -index d8e6c88..669b73e 100644 +index 5c6afc4..9ed3466 100644 --- a/src/main/uk/ac/starlink/topcat/ResourceIcon.java +++ b/src/main/uk/ac/starlink/topcat/ResourceIcon.java -@@ -682,10 +682,10 @@ public class ResourceIcon implements Icon { +@@ -684,10 +684,10 @@ public class ResourceIcon implements Icon { new Ri1RegistryTableLoadDialog().getIcon() ); putMap( nameMap, "HELP_TOC", new ImageIcon( JHelp.class diff -Nru starjava-topcat-4.7/debian/patches/Make-CDF-optional.patch starjava-topcat-4.7.1/debian/patches/Make-CDF-optional.patch --- starjava-topcat-4.7/debian/patches/Make-CDF-optional.patch 2020-01-20 16:21:21.000000000 +0000 +++ starjava-topcat-4.7.1/debian/patches/Make-CDF-optional.patch 2020-06-26 11:31:47.000000000 +0000 @@ -7,10 +7,10 @@ 1 file changed, 3 insertions(+) diff --git a/src/docs/sun253.xml b/src/docs/sun253.xml -index 04b8b6a..b87185f 100644 +index bd56eae..79e4e2d 100644 --- a/src/docs/sun253.xml +++ b/src/docs/sun253.xml -@@ -1316,6 +1316,9 @@ write them. +@@ -1392,6 +1392,9 @@ write them. Currently, no attempt is made to represent values representing times in a human-friendly fashion. This may change in future releases.

diff -Nru starjava-topcat-4.7/debian/patches/Remove-edu.jhu.htm-reference.patch starjava-topcat-4.7.1/debian/patches/Remove-edu.jhu.htm-reference.patch --- starjava-topcat-4.7/debian/patches/Remove-edu.jhu.htm-reference.patch 2020-01-20 16:21:21.000000000 +0000 +++ starjava-topcat-4.7.1/debian/patches/Remove-edu.jhu.htm-reference.patch 2020-06-26 11:31:47.000000000 +0000 @@ -28,10 +28,10 @@ 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/docs/sun253.xml b/src/docs/sun253.xml -index 55fe3b6..fe0105b 100644 +index 81188fd..f28a23b 100644 --- a/src/docs/sun253.xml +++ b/src/docs/sun253.xml -@@ -18661,13 +18661,8 @@ of a metric on that space to count as a match. +@@ -19234,13 +19234,8 @@ of a metric on that space to count as a match.

HTM
@@ -48,18 +48,18 @@

diff --git a/src/main/uk/ac/starlink/topcat/join/MatchWindow.java b/src/main/uk/ac/starlink/topcat/join/MatchWindow.java -index 0d17961..2483cea 100644 +index 4e9e394..c68df15 100644 --- a/src/main/uk/ac/starlink/topcat/join/MatchWindow.java +++ b/src/main/uk/ac/starlink/topcat/join/MatchWindow.java -@@ -34,7 +34,6 @@ import uk.ac.starlink.table.join.EllipseSkyMatchEngine; +@@ -35,7 +35,6 @@ import uk.ac.starlink.table.join.EllipseSkyMatchEngine; import uk.ac.starlink.table.join.ErrorCartesianMatchEngine; import uk.ac.starlink.table.join.ErrorSkyMatchEngine; import uk.ac.starlink.table.join.EqualsMatchEngine; -import uk.ac.starlink.table.join.HtmSkyPixellator; import uk.ac.starlink.table.join.IsotropicCartesianMatchEngine; import uk.ac.starlink.table.join.MatchEngine; - import uk.ac.starlink.table.join.PixtoolsHealpixSkyPixellator; -@@ -450,12 +449,6 @@ public class MatchWindow extends AuxWindow implements ItemListener { + import uk.ac.starlink.table.join.ProgressIndicator; +@@ -449,12 +448,6 @@ public class MatchWindow extends AuxWindow implements ItemListener { new AnisotropicCartesianMatchEngine( someLengths2 ), } ); @@ -70,9 +70,9 @@ - } - }; return new MatchEngine[] { - new FixedSkyMatchEngine( new PixtoolsHealpixSkyPixellator(), - someAngle ), -@@ -479,7 +472,6 @@ public class MatchWindow extends AuxWindow implements ItemListener { + new FixedSkyMatchEngine( new CdsHealpixSkyPixellator(), someAngle ), + new ErrorSkyMatchEngine( new CdsHealpixSkyPixellator(), someAngle ), +@@ -476,7 +469,6 @@ public class MatchWindow extends AuxWindow implements ItemListener { new AnisotropicCartesianMatchEngine( someLengths4 ), skyPlus1Engine, skyPlus2Engine, diff -Nru starjava-topcat-4.7/debian/patches/Remove-GBIN-references.patch starjava-topcat-4.7.1/debian/patches/Remove-GBIN-references.patch --- starjava-topcat-4.7/debian/patches/Remove-GBIN-references.patch 2020-01-20 16:21:21.000000000 +0000 +++ starjava-topcat-4.7.1/debian/patches/Remove-GBIN-references.patch 2020-06-26 11:31:47.000000000 +0000 @@ -7,7 +7,7 @@ 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/docs/sun253.xml b/src/docs/sun253.xml -index 4687c9a..04b8b6a 100644 +index 9d0fca3..bd56eae 100644 --- a/src/docs/sun253.xml +++ b/src/docs/sun253.xml @@ -13,9 +13,6 @@ @@ -20,25 +20,25 @@ -@@ -650,7 +647,7 @@ something like +@@ -668,7 +665,7 @@ something like java -jar topcat-full.jar (see for more detail). To view a table that you have on disk, you can either give its name on the command line or load it using the --button from the GUI. FITS, VOTable, CDF and GBIN files +-button from the GUI. FITS, VOTable, ECSV, CDF, feather and GBIN files +button from the GUI. FITS, VOTable and CDF files are recognised automatically; if your data is in another format such as ASCII (see ) you need to tell the program (e.g. -f ascii on the command line). -@@ -1136,7 +1133,7 @@ supported input formats have matching output formats and vice versa. +@@ -1155,7 +1152,7 @@ supported input formats have matching output formats and vice versa.

Loading tables into TOPCAT is done either from the command line when you start the program up or using the Load Table dialogue. --For FITS, VOTable, CDF and GBIN formats +-For FITS, VOTable, ECSV, CDF, feather and GBIN formats +For FITS, VOTable and CDF formats the file format can be detected automatically (note this is done by looking at the file content, it has nothing to do with filename extensions). -@@ -1520,9 +1517,12 @@ you wish to load a table in csv format. +@@ -1636,9 +1633,12 @@ you wish to load a table in csv format. GBIN diff -Nru starjava-topcat-4.7/debian/patches/Remove-MIRAGE-references.patch starjava-topcat-4.7.1/debian/patches/Remove-MIRAGE-references.patch --- starjava-topcat-4.7/debian/patches/Remove-MIRAGE-references.patch 2020-01-20 16:21:21.000000000 +0000 +++ starjava-topcat-4.7.1/debian/patches/Remove-MIRAGE-references.patch 2020-06-26 11:31:47.000000000 +0000 @@ -7,10 +7,10 @@ 1 file changed, 4 insertions(+) diff --git a/src/docs/sun253.xml b/src/docs/sun253.xml -index b87185f..9a1a244 100644 +index 79e4e2d..457611e 100644 --- a/src/docs/sun253.xml +++ b/src/docs/sun253.xml -@@ -2047,6 +2047,10 @@ suitable for insertion into a document intended for publication. +@@ -2198,6 +2198,10 @@ suitable for insertion into a document intended for publication. Mirage Format diff -Nru starjava-topcat-4.7/debian/patches/Remove-plastic-support.patch starjava-topcat-4.7.1/debian/patches/Remove-plastic-support.patch --- starjava-topcat-4.7/debian/patches/Remove-plastic-support.patch 2020-01-20 16:21:21.000000000 +0000 +++ starjava-topcat-4.7.1/debian/patches/Remove-plastic-support.patch 2020-06-26 11:31:47.000000000 +0000 @@ -5,14 +5,14 @@ Plastic is very outdated now, and should not be used anymore. This enables to remove a number of dependencies. --- - build.xml | 19 +++- - src/docs/sun253.xml | 102 ++++++---------------- - src/main/uk/ac/starlink/topcat/ControlWindow.java | 6 -- - src/main/uk/ac/starlink/topcat/Driver.java | 15 +--- - 4 files changed, 43 insertions(+), 99 deletions(-) + build.xml | 19 ++++- + src/docs/sun253.xml | 99 ++++++----------------- + src/main/uk/ac/starlink/topcat/ControlWindow.java | 6 -- + src/main/uk/ac/starlink/topcat/Driver.java | 15 +--- + 4 files changed, 42 insertions(+), 97 deletions(-) diff --git a/build.xml b/build.xml -index 4835ecc..9a32164 100644 +index e2c7a1a..c990640 100644 --- a/build.xml +++ b/build.xml @@ -434,7 +434,13 @@ @@ -50,10 +50,10 @@ . +@@ -2708,7 +2708,7 @@ The windows from which this is done are documented in .

Note: @@ -62,7 +62,7 @@ within the Virtual Observatory context, but are not necessarily concerned with remote data access, see .

-@@ -3578,7 +3578,7 @@ messaging protocols: +@@ -3729,7 +3729,7 @@ messaging protocols:
  • SAMP (Simple Applications Messaging Protocol)
  • PLASTIC @@ -71,7 +71,7 @@ An example of the kind of thing which can be done might be:
      -@@ -3614,9 +3614,8 @@ and others. +@@ -3765,9 +3765,8 @@ and others. the same way. SAMP is an evolution of PLASTIC with a number of technical improvements, and PLASTIC has been deprecated in favour of SAMP since around 2009. @@ -83,7 +83,7 @@

      The communication architecture of the two protocols is basically the same: -@@ -3628,18 +3627,6 @@ it will connect to it automatically. +@@ -3779,18 +3778,6 @@ it will connect to it automatically. If no SAMP hub is running, TOPCAT will set one up during application startup.

      @@ -102,7 +102,7 @@

      This communication has two aspects to it: on the one hand TOPCAT can send messages to other applications which causes them to do things, and on the other hand TOPCAT can receive and act on -@@ -3650,7 +3637,7 @@ The +@@ -3801,7 +3788,7 @@ The messages are described separately in the subsections below. There are also sections on the, somewhat different, ways to control and monitor messaging operatiion @@ -111,7 +111,7 @@

      Note that the new activation action -@@ -3718,9 +3705,8 @@ by other SAMP applications. +@@ -3869,9 +3856,8 @@ by other SAMP applications. PLASTIC control @@ -123,7 +123,7 @@

      You can view and control operations relating to the PLASTIC hub -@@ -3779,9 +3765,8 @@ It contains the following options: +@@ -3930,9 +3916,8 @@ It contains the following options: Messages Transmitted

      This section describes the messages which TOPCAT can transmit to other @@ -135,7 +135,7 @@

      In most cases you can choose two ways to transmit a message -@@ -3811,7 +3796,7 @@ which claim to support the relevant message. +@@ -3962,7 +3947,7 @@ which claim to support the relevant message.

      Below is a list of places you can cause TOPCAT to transmit messages. @@ -144,7 +144,7 @@ are listed along with the descriptions; unless you are a tool developer you can probably ignore these. -@@ -3832,10 +3817,6 @@ unless you are a tool developer you can probably ignore these. +@@ -3983,10 +3968,6 @@ unless you are a tool developer you can probably ignore these.

      SAMP MTypes: table.load.votable or table.load.fits @@ -155,7 +155,7 @@

      Transmit Subset
      -@@ -3853,7 +3834,7 @@ unless you are a tool developer you can probably ignore these. +@@ -4004,7 +3985,7 @@ unless you are a tool developer you can probably ignore these. (1) the table has been loaded from the same URL/filename by the other tool(s) or (2) the other tool(s) have acquired the table because it has @@ -164,7 +164,7 @@

      Also, whenever a new subset is created, for instance by entering an algebraic expression or tracing out a region on a plot -@@ -3863,8 +3844,6 @@ unless you are a tool developer you can probably ignore these. +@@ -4014,8 +3995,6 @@ unless you are a tool developer you can probably ignore these. the table's subset list.

      SAMP MType: table.select.rowList @@ -173,7 +173,7 @@

      Transmit Row
      -@@ -3901,8 +3880,6 @@ unless you are a tool developer you can probably ignore these. +@@ -4052,8 +4031,6 @@ unless you are a tool developer you can probably ignore these. and this can be sent to image applications from its Interop menu.

      SAMP MType: image.load.fits @@ -182,7 +182,7 @@

      Transmit Spectrum
      -@@ -3919,7 +3896,6 @@ unless you are a tool developer you can probably ignore these. +@@ -4070,7 +4047,6 @@ unless you are a tool developer you can probably ignore these. present in most of the Virtual Observatory windows allows you to send lists of VO registry resource identifiers to other applications which can make use of them. @@ -190,7 +190,7 @@

      SAMP MTypes: voresource.loadlist.cone, voresource.loadlist.siap, -@@ -3934,8 +3910,8 @@ unless you are a tool developer you can probably ignore these. +@@ -4085,8 +4061,8 @@ unless you are a tool developer you can probably ignore these. Messages Received

      This section describes the messages which TOPCAT will respond to @@ -201,7 +201,7 @@ unless you are a tool developer you can probably ignore these.

      -@@ -3950,10 +3926,6 @@ unless you are a tool developer you can probably ignore these. +@@ -4101,10 +4077,6 @@ unless you are a tool developer you can probably ignore these. table.load.cdf or table.load.stil

      @@ -212,7 +212,7 @@

      Note the non-standard MType table.load.stil is supported for loading tables with SAMP. This is like the other table.load.* MTypes, but any table format supported -@@ -3983,8 +3955,6 @@ unless you are a tool developer you can probably ignore these. +@@ -4134,8 +4106,6 @@ unless you are a tool developer you can probably ignore these. treated may be made available in future versions.

      SAMP MType: table.select.rowList @@ -221,7 +221,7 @@

      Highlight Row
      -@@ -3997,8 +3967,6 @@ unless you are a tool developer you can probably ignore these. +@@ -4148,8 +4118,6 @@ unless you are a tool developer you can probably ignore these. in the Activation Window.

      SAMP MType: table.highlight.row @@ -230,7 +230,7 @@

      Load Resource Identifiers
      -@@ -4051,15 +4019,6 @@ For SAMP these are: +@@ -4202,15 +4170,6 @@ For SAMP these are:
    1. samp.hub.event.subscriptions
    2. samp.app.ping
    3. @@ -246,7 +246,7 @@

      -@@ -4253,29 +4212,23 @@ The meaning of the flags is as follows: +@@ -4404,29 +4363,23 @@ The meaning of the flags is as follows:
      -samp

      Forces TOPCAT to use SAMP for tool interoperability @@ -280,7 +280,7 @@ if no hub is already running. The hub will show up in its own window, and can be stopped by closing the window. The hub will continue to run -@@ -4286,8 +4239,8 @@ The meaning of the flags is as follows: +@@ -4437,8 +4390,8 @@ The meaning of the flags is as follows:

      -noserv
      @@ -291,7 +291,7 @@

      -checkvers
      -@@ -5668,7 +5621,7 @@ of the current status of SAMP communications. +@@ -5823,7 +5776,7 @@ of the current status of SAMP communications. For a discussion of the whats and whys of SAMP, see . Note that if not running in SAMP mode @@ -300,7 +300,7 @@ SAMP mode is the default under normal circumstances.

      -@@ -5738,7 +5691,7 @@ functions. They are grouped as follows: +@@ -5893,7 +5846,7 @@ functions. They are grouped as follows:
      &IMG.BROADCAST; Broadcast Table

      Broadcasts the current to any @@ -309,17 +309,7 @@ See .

      -@@ -5857,8 +5810,7 @@ functions. They are grouped as follows: -
      &IMG.SAMP; SAMP Window
      -

      Displays a window which displays detail about the current - status, and allows configuration, of SAMP messaging -- (see ). Note this button will not be -- visible if TOPCAT is running in PLASTIC mode. -+ (see ). -

      - -
      &IMG.FUNCTION; Available Functions
      -@@ -5936,7 +5888,7 @@ and those common to other windows (described in ). +@@ -6089,7 +6042,7 @@ and those common to other windows (described in ).
      &IMG.SEND; Send Table to ...

      Sends the currently selected table to a selected listening application @@ -328,16 +318,16 @@ submenu.

      &IMG.LOG; View Log
      -@@ -6112,7 +6064,7 @@ the menu. +@@ -6257,7 +6210,7 @@ the menu.

      The menu contains options relevant to --tool interoperability (SAMP or PLASTIC). These items are available -+tool interoperability (SAMP). These items are available - elsewhere on the toolbar or menu. -

      +-SAMP (or possibly PLASTIC) tool interoperability; ++SAMP tool interoperability; + see : -@@ -6827,7 +6779,7 @@ can be edited by double-clicking on them in the normal way. +
      +@@ -7000,7 +6953,7 @@ can be edited by double-clicking on them in the normal way.

      &IMG.BROADCAST; Broadcast Subset
      @@ -346,7 +336,7 @@ listening applications. Any other listening application which is displaying the same table is then invited to highlight the selection of rows corresonding to the selected subset. -@@ -17088,9 +17040,9 @@ or manually as described in . +@@ -17660,9 +17613,9 @@ or manually as described in . displayed image for external viewing or analysis. As well as options to export as GIF, JPEG, EPS and FITS, there is also the option to transmit the FITS image to one or @@ -359,7 +349,7 @@ See for more information about tool interoperability.

      diff --git a/src/main/uk/ac/starlink/topcat/ControlWindow.java b/src/main/uk/ac/starlink/topcat/ControlWindow.java -index ce5641d..8a5d617 100644 +index 13955b1..b4479fd 100644 --- a/src/main/uk/ac/starlink/topcat/ControlWindow.java +++ b/src/main/uk/ac/starlink/topcat/ControlWindow.java @@ -84,7 +84,6 @@ import javax.swing.event.TableModelEvent; @@ -378,7 +368,7 @@ import uk.ac.starlink.topcat.interop.SampCommunicator; import uk.ac.starlink.topcat.interop.TopcatCommunicator; import uk.ac.starlink.topcat.interop.Transmitter; -@@ -1537,10 +1535,6 @@ public class ControlWindow extends AuxWindow +@@ -1527,10 +1525,6 @@ public class ControlWindow extends AuxWindow logger_.info( "Run with no interop" ); return null; } @@ -390,10 +380,10 @@ final String msg; if ( "samp".equals( interopType_ ) ) { diff --git a/src/main/uk/ac/starlink/topcat/Driver.java b/src/main/uk/ac/starlink/topcat/Driver.java -index 502dcef..de44aa9 100644 +index d4b9888..e23c93d 100644 --- a/src/main/uk/ac/starlink/topcat/Driver.java +++ b/src/main/uk/ac/starlink/topcat/Driver.java -@@ -22,8 +22,6 @@ import org.astrogrid.samp.client.DefaultClientProfile; +@@ -20,8 +20,6 @@ import org.astrogrid.samp.client.DefaultClientProfile; import org.astrogrid.samp.client.SampException; import org.astrogrid.samp.httpd.UtilServer; import uk.ac.starlink.fits.FitsConstants; @@ -402,7 +392,7 @@ import uk.ac.starlink.table.DefaultValueInfo; import uk.ac.starlink.table.DescribedValue; import uk.ac.starlink.table.ValueInfo; -@@ -230,7 +228,7 @@ public class Driver { +@@ -229,7 +227,7 @@ public class Driver { pre + " [-help] [-version]" + pad + " [-stilts |-jsamp ]" + pad + " [-verbose] [-debug] [-demo] [-running] [-memory|-disk]" @@ -411,7 +401,7 @@ + pad + " [[-f ] table ...]"; /* Standalone execution (e.g. System.exit() may be called). */ -@@ -320,15 +318,6 @@ public class Driver { +@@ -319,15 +317,6 @@ public class Driver { interopServe = true; ControlWindow.interopType_ = "samp"; } @@ -427,7 +417,7 @@ else if ( arg.startsWith( "-noserv" ) ) { it.remove(); interopServe = false; -@@ -655,8 +644,6 @@ public class Driver { +@@ -654,8 +643,6 @@ public class Driver { .append( p2 + "-disk use disk backing store for " + "large tables" ) .append( p2 + "-samp use SAMP for tool interoperability" ) diff -Nru starjava-topcat-4.7/debian/patches/Remove-references-to-SRB-and-MySpace.patch starjava-topcat-4.7.1/debian/patches/Remove-references-to-SRB-and-MySpace.patch --- starjava-topcat-4.7/debian/patches/Remove-references-to-SRB-and-MySpace.patch 2020-01-20 16:21:21.000000000 +0000 +++ starjava-topcat-4.7.1/debian/patches/Remove-references-to-SRB-and-MySpace.patch 2020-06-26 11:31:47.000000000 +0000 @@ -7,10 +7,10 @@ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/docs/sun253.xml b/src/docs/sun253.xml -index 9a1a244..19c7e4a 100644 +index 457611e..cd0277d 100644 --- a/src/docs/sun253.xml +++ b/src/docs/sun253.xml -@@ -2161,7 +2161,7 @@ allowed: +@@ -2312,7 +2312,7 @@ allowed: To use them you must have an AstroGrid account and the AstroGrid WorkBench or similar must be running; if you're not currently logged in a dialogue will pop up to ask you for name and @@ -19,7 +19,7 @@
      ivo:

      Understands ivo-type URLs which signify files in the AstroGrid "MySpace" virtual file store. -@@ -2171,7 +2171,7 @@ allowed: +@@ -2322,7 +2322,7 @@ allowed: To use them you must have an AstroGrid account and the AstroGrid WorkBench or similar must be running; if you're not currently logged in a dialogue will pop up to ask you for name and @@ -28,7 +28,7 @@

      jdbc:

      Used for communicating with SQL-compliant relational databases. These are a bit different to normal URLs - see -@@ -17291,6 +17291,10 @@ components of TOPCAT, and it may not be available if you +@@ -17864,6 +17864,10 @@ components of TOPCAT, and it may not be available if you have the topcat-lite configuration.

      @@ -39,7 +39,7 @@

      The browser initially displays the current directory, but this can be changed by typing a new directory into the field, or moving up the directory hierarchy using the selector box at the top, -@@ -17409,7 +17413,7 @@ Nodes which represent tables are indicated by the +@@ -17982,7 +17986,7 @@ Nodes which represent tables are indicated by the For nodes which have some internal structure there is also a "handle" which indicates whether they are collapsed (&IMG.COLLAPSED;) or expanded (&IMG.EXPANDED;). @@ -48,7 +48,7 @@ as well as local ones in the same way as with the Filestore Browser.

      -@@ -18343,11 +18347,6 @@ The initial default directory can be changed by setting the +@@ -18916,11 +18920,6 @@ The initial default directory can be changed by setting the system property.

      diff -Nru starjava-topcat-4.7/debian/patches/Remove-references-to-xdoc-and-ttools.patch starjava-topcat-4.7.1/debian/patches/Remove-references-to-xdoc-and-ttools.patch --- starjava-topcat-4.7/debian/patches/Remove-references-to-xdoc-and-ttools.patch 2020-01-20 16:21:21.000000000 +0000 +++ starjava-topcat-4.7.1/debian/patches/Remove-references-to-xdoc-and-ttools.patch 2020-06-26 11:31:47.000000000 +0000 @@ -12,7 +12,7 @@ 2 files changed, 8 insertions(+), 31 deletions(-) diff --git a/build.xml b/build.xml -index 78297bc..a93e36d 100644 +index 4cdd51f..e571c72 100644 --- a/build.xml +++ b/build.xml @@ -186,7 +186,7 @@ @@ -99,7 +99,7 @@ diff --git a/src/docs/sun253.xml b/src/docs/sun253.xml -index fe0105b..131e818 100644 +index f28a23b..a3daafb 100644 --- a/src/docs/sun253.xml +++ b/src/docs/sun253.xml @@ -8,7 +8,6 @@ @@ -110,7 +110,7 @@ -@@ -23929,8 +23928,6 @@ available from within TOPCAT +@@ -24533,8 +24532,6 @@ available from within TOPCAT in the Available Functions Window.

      diff -Nru starjava-topcat-4.7/debian/patches/Remove-SOG-references.patch starjava-topcat-4.7.1/debian/patches/Remove-SOG-references.patch --- starjava-topcat-4.7/debian/patches/Remove-SOG-references.patch 2020-01-20 16:21:21.000000000 +0000 +++ starjava-topcat-4.7.1/debian/patches/Remove-SOG-references.patch 2020-06-26 11:31:47.000000000 +0000 @@ -18,7 +18,7 @@ 8 files changed, 40 insertions(+), 76 deletions(-) diff --git a/build.xml b/build.xml -index 9a32164..bb680c9 100644 +index c990640..746b41a 100644 --- a/build.xml +++ b/build.xml @@ -440,6 +440,10 @@ @@ -121,10 +121,10 @@ diff --git a/src/docs/sun253.xml b/src/docs/sun253.xml -index 12aeb6b..55fe3b6 100644 +index c5e73a6..81188fd 100644 --- a/src/docs/sun253.xml +++ b/src/docs/sun253.xml -@@ -22605,23 +22605,8 @@ option in one of the DataLink-related actions, +@@ -23209,23 +23209,8 @@ option in one of the DataLink-related actions, TOPCAT will try to display an image in an internal image viewer.

      @@ -173,7 +173,7 @@ classList.add( Mgc.class ); classList.add( Sdss.class ); diff --git a/src/main/uk/ac/starlink/topcat/TopcatUtils.java b/src/main/uk/ac/starlink/topcat/TopcatUtils.java -index a71bf6a..d9d85d0 100644 +index 3f4b627..b16b9b5 100644 --- a/src/main/uk/ac/starlink/topcat/TopcatUtils.java +++ b/src/main/uk/ac/starlink/topcat/TopcatUtils.java @@ -394,24 +394,7 @@ public class TopcatUtils { @@ -226,10 +226,10 @@ } }; diff --git a/src/main/uk/ac/starlink/topcat/activate/ActivationWindow.java b/src/main/uk/ac/starlink/topcat/activate/ActivationWindow.java -index 126acc5..4aa13ec 100644 +index 8d3f97f..10ca437 100644 --- a/src/main/uk/ac/starlink/topcat/activate/ActivationWindow.java +++ b/src/main/uk/ac/starlink/topcat/activate/ActivationWindow.java -@@ -903,8 +903,6 @@ public class ActivationWindow extends AuxWindow { +@@ -901,8 +901,6 @@ public class ActivationWindow extends AuxWindow { new SendHips2fitsActivationType(), new InvokeDatalinkActivationType(), new ViewDatalinkActivationType(), @@ -256,7 +256,7 @@ } } diff --git a/src/main/uk/ac/starlink/topcat/interop/SampImageActivity.java b/src/main/uk/ac/starlink/topcat/interop/SampImageActivity.java -index 9cde958..643e7f0 100644 +index b513763..2e727bf 100644 --- a/src/main/uk/ac/starlink/topcat/interop/SampImageActivity.java +++ b/src/main/uk/ac/starlink/topcat/interop/SampImageActivity.java @@ -21,7 +21,6 @@ import org.astrogrid.samp.gui.GuiHubConnector; @@ -267,7 +267,7 @@ import uk.ac.starlink.util.URLUtils; /** -@@ -178,14 +177,6 @@ public class SampImageActivity implements ImageActivity { +@@ -177,14 +176,6 @@ public class SampImageActivity implements ImageActivity { return true; } } ); diff -Nru starjava-topcat-4.7/debian/patches/Use-a-local-copy-of-the-XSLT-stylesheets-instead-of-xdoc.patch starjava-topcat-4.7.1/debian/patches/Use-a-local-copy-of-the-XSLT-stylesheets-instead-of-xdoc.patch --- starjava-topcat-4.7/debian/patches/Use-a-local-copy-of-the-XSLT-stylesheets-instead-of-xdoc.patch 2020-01-20 16:21:21.000000000 +0000 +++ starjava-topcat-4.7.1/debian/patches/Use-a-local-copy-of-the-XSLT-stylesheets-instead-of-xdoc.patch 2020-06-26 11:31:47.000000000 +0000 @@ -11,7 +11,7 @@ 3 files changed, 63 insertions(+), 111 deletions(-) diff --git a/build.xml b/build.xml -index a93e36d..c5be189 100644 +index e571c72..e1d0257 100644 --- a/build.xml +++ b/build.xml @@ -107,7 +107,7 @@ diff -Nru starjava-topcat-4.7/debian/patches/Use-android-json.patch starjava-topcat-4.7.1/debian/patches/Use-android-json.patch --- starjava-topcat-4.7/debian/patches/Use-android-json.patch 2020-01-20 16:21:21.000000000 +0000 +++ starjava-topcat-4.7.1/debian/patches/Use-android-json.patch 2020-06-26 11:31:47.000000000 +0000 @@ -7,7 +7,6 @@ The libjson-java code is different and contains net.sf.json (which however has classes of the same name...) - --- src/main/uk/ac/starlink/topcat/TopcatCodec2.java | 5 +++-- .../uk/ac/starlink/topcat/activate/HipsSurvey.java | 26 +++++++++++++++++----- diff -Nru starjava-topcat-4.7/.properties starjava-topcat-4.7.1/.properties --- starjava-topcat-4.7/.properties 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/.properties 2020-06-04 17:10:04.000000000 +0000 @@ -9,6 +9,7 @@ ../votable/votable.jar \ ../fits/fits.jar \ ../cdf/cdf.jar \ + ../feather/feather.jar \ ../gbin/gbin.jar \ ../dpac/dpac.jar \ ../datanode/datanode.jar \ Binary files /tmp/tmpTSobSo/ZvDaKaP__y/starjava-topcat-4.7/src/docs/figures/ControlWindow.png and /tmp/tmpTSobSo/HZ9XEzUYIi/starjava-topcat-4.7.1/src/docs/figures/ControlWindow.png differ Binary files /tmp/tmpTSobSo/ZvDaKaP__y/starjava-topcat-4.7/src/docs/figures/form_area.png and /tmp/tmpTSobSo/HZ9XEzUYIi/starjava-topcat-4.7.1/src/docs/figures/form_area.png differ Binary files /tmp/tmpTSobSo/ZvDaKaP__y/starjava-topcat-4.7/src/docs/figures/form_contour.png and /tmp/tmpTSobSo/HZ9XEzUYIi/starjava-topcat-4.7.1/src/docs/figures/form_contour.png differ Binary files /tmp/tmpTSobSo/ZvDaKaP__y/starjava-topcat-4.7/src/docs/figures/form_poly4.png and /tmp/tmpTSobSo/HZ9XEzUYIi/starjava-topcat-4.7.1/src/docs/figures/form_poly4.png differ Binary files /tmp/tmpTSobSo/ZvDaKaP__y/starjava-topcat-4.7/src/docs/figures/form_skyvector.png and /tmp/tmpTSobSo/HZ9XEzUYIi/starjava-topcat-4.7.1/src/docs/figures/form_skyvector.png differ Binary files /tmp/tmpTSobSo/ZvDaKaP__y/starjava-topcat-4.7/src/docs/figures/GangLayerControl_area_form.png and /tmp/tmpTSobSo/HZ9XEzUYIi/starjava-topcat-4.7.1/src/docs/figures/GangLayerControl_area_form.png differ Binary files /tmp/tmpTSobSo/ZvDaKaP__y/starjava-topcat-4.7/src/docs/figures/GangLayerControl_area.png and /tmp/tmpTSobSo/HZ9XEzUYIi/starjava-topcat-4.7.1/src/docs/figures/GangLayerControl_area.png differ Binary files /tmp/tmpTSobSo/ZvDaKaP__y/starjava-topcat-4.7/src/docs/figures/GangLayerControl_area_position.png and /tmp/tmpTSobSo/HZ9XEzUYIi/starjava-topcat-4.7.1/src/docs/figures/GangLayerControl_area_position.png differ Binary files /tmp/tmpTSobSo/ZvDaKaP__y/starjava-topcat-4.7/src/docs/figures/GangLayerControl_quad_form.png and /tmp/tmpTSobSo/HZ9XEzUYIi/starjava-topcat-4.7.1/src/docs/figures/GangLayerControl_quad_form.png differ Binary files /tmp/tmpTSobSo/ZvDaKaP__y/starjava-topcat-4.7/src/docs/figures/GangLayerControl_quad_position.png and /tmp/tmpTSobSo/HZ9XEzUYIi/starjava-topcat-4.7.1/src/docs/figures/GangLayerControl_quad_position.png differ Binary files /tmp/tmpTSobSo/ZvDaKaP__y/starjava-topcat-4.7/src/docs/figures/multishot-mini.png and /tmp/tmpTSobSo/HZ9XEzUYIi/starjava-topcat-4.7.1/src/docs/figures/multishot-mini.png differ Binary files /tmp/tmpTSobSo/ZvDaKaP__y/starjava-topcat-4.7/src/docs/figures/SiaMultiWindow.png and /tmp/tmpTSobSo/HZ9XEzUYIi/starjava-topcat-4.7.1/src/docs/figures/SiaMultiWindow.png differ Binary files /tmp/tmpTSobSo/ZvDaKaP__y/starjava-topcat-4.7/src/docs/figures/SiapTableLoadDialog.png and /tmp/tmpTSobSo/HZ9XEzUYIi/starjava-topcat-4.7.1/src/docs/figures/SiapTableLoadDialog.png differ Binary files /tmp/tmpTSobSo/ZvDaKaP__y/starjava-topcat-4.7/src/docs/figures/SpectrogramLayerControl_data.png and /tmp/tmpTSobSo/HZ9XEzUYIi/starjava-topcat-4.7.1/src/docs/figures/SpectrogramLayerControl_data.png differ Binary files /tmp/tmpTSobSo/ZvDaKaP__y/starjava-topcat-4.7/src/docs/figures/SpectrogramLayerControl.png and /tmp/tmpTSobSo/HZ9XEzUYIi/starjava-topcat-4.7.1/src/docs/figures/SpectrogramLayerControl.png differ Binary files /tmp/tmpTSobSo/ZvDaKaP__y/starjava-topcat-4.7/src/docs/figures/TimePlotWindow.png and /tmp/tmpTSobSo/HZ9XEzUYIi/starjava-topcat-4.7.1/src/docs/figures/TimePlotWindow.png differ Binary files /tmp/tmpTSobSo/ZvDaKaP__y/starjava-topcat-4.7/src/docs/multishot.png and /tmp/tmpTSobSo/HZ9XEzUYIi/starjava-topcat-4.7.1/src/docs/multishot.png differ diff -Nru starjava-topcat-4.7/src/docs/sun253.xml starjava-topcat-4.7.1/src/docs/sun253.xml --- starjava-topcat-4.7/src/docs/sun253.xml 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/docs/sun253.xml 2020-06-04 17:10:04.000000000 +0000 @@ -154,6 +154,11 @@ '&figs;GangLayerControl_quad_position.png'> + + + + @@ -303,6 +309,9 @@ + + + @@ -334,6 +343,9 @@ Histogram Layer Control'> + Area Layer Control'> Spectrogram Layer Control'> @@ -368,7 +380,9 @@ Linear Fit'> Quantile'> - Text Label'> + Label'> + Area Label'> Contour'> Mark2'> Poly4'> Mark4'> + Area'> + Central'> + AreaLabel'> Polgon'> + Polygon'> @@ -415,7 +433,7 @@ 253 -18 November 2019 +5 June 2020 TOPCAT web page: @@ -615,7 +633,7 @@ java -jar topcat-full.jar (see for more detail). To view a table that you have on disk, you can either give its name on the command line or load it using the -button from the GUI. FITS, VOTable, CDF and GBIN files +button from the GUI. FITS, VOTable, ECSV, CDF, feather and GBIN files are recognised automatically; if your data is in another format such as ASCII (see ) you need to tell the program (e.g. -f ascii on the command line). @@ -646,7 +664,8 @@ &IMG.PLOT2_PLANE; &IMG.PLOT2_CUBE; &IMG.PLOT2_SKY; - &IMG.PLOT2_SPHERE; + &IMG.PLOT2_SPHERE; + &IMG.PLOT2_TIME;

      Open plotting/visualisation windows of various kinds.

      &IMG.MATCH2; &IMG.TAP_DIALOG; &IMG.CDSXMATCH;
      @@ -1101,7 +1120,7 @@

      Loading tables into TOPCAT is done either from the command line when you start the program up or using the Load Table dialogue. -For FITS, VOTable, CDF and GBIN formats +For FITS, VOTable, ECSV, CDF, feather and GBIN formats the file format can be detected automatically (note this is done by looking at the file content, it has nothing to do with filename extensions). @@ -1271,6 +1290,63 @@ + +ECSV + +

      The Enhanced Character Separated Values format was developed within +the Astropy project +and is described at +. +It is composed of a YAML header followed by a CSV-like body, +and is intended to be a human-readable and maybe even human-writable format +with rich metadata. +Most of the per-column and per-table metadata used by TOPCAT +is preserved when de/serializing to this format. +TOPCAT currently supports ECSV 0.9. +

      + +

      There are various ways to format the YAML header, +but a simple example of an ECSV file looks like this: + +# %ECSV 0.9 +# --- +# delimiter: ',' +# datatype: [ +# { name: index, datatype: int32 }, +# { name: Species, datatype: string }, +# { name: Name, datatype: string }, +# { name: Legs, datatype: int32 }, +# { name: Height, datatype: float64, unit: m }, +# { name: Mammal, datatype: bool }, +# ] +index,Species,Name,Legs,Height,Mammal +1,pig,Bland,4,,True +2,cow,Daisy,4,2,True +3,goldfish,Dobbin,,0.05,False +4,ant,,6,0.001,False +5,ant,,6,0.001,False +6,human,Mark,2,1.9,True + +If you follow this pattern, it's possible to write your own ECSV files by +taking an existing CSV file +and decorating it with a header that gives column datatypes, +and possibly other metadata such as units. +This allows you to force the datatype of given columns +(the CSV reader guesses datatype based on content, but can get it wrong) +and also allows TOPCAT to read the file much more efficiently, +and to recognise the file format automatically. +

      + +

      The datatypes that work well with TOPCAT are +bool, +int8, int16, int32, int64, +float32, float64 +and +string. +

      + + + CDF @@ -1287,6 +1363,30 @@ + +Feather + +

      The Feather file format is a column-oriented binary disk-based format +based on Apache Arrow and supported by (at least) Python, R and Julia. +Some description of it is available at + and +. +It can be used for large datasets, but it does not support +array-valued columns. +It can be a useful format to use for exchanging data with R, +for which FITS I/O is reported to be slow. +

      + +

      At present CATEGORY type columns are not supported, +and metadata associated with TIME, DATE and TIMESTAMP +columns is not retrieved. +

      + +

      Feather can only read files that are on disk, not streamed. +

      + +
      + ASCII @@ -1476,6 +1576,22 @@ (or anything else) to introduce "comment" lines.

      +

      Because the CSV format contains no metadata beyond column names, +TOPCAT is forced to guess the datatype of the values in each column. +It does this by reading the whole file through once and guessing +on the basis of what it has seen. This has the disadvantages: +

        +
      • Sometimes it guesses a different type than what you want + (e.g. 32-bit integer rather than 64-bit integer)
      • +
      • It's slow to read.
      • +
      +This means that CSV is not generally recommended if you can +use another format instead. +If you're stuck with a large CSV file that's misbehaving or slow +to use, one possibility is to turn it into an +ECSV file by adding some header lines by hand. +

      +

      This format is not detected automatically - you must specify that you wish to load a table in csv format.

      @@ -1818,6 +1934,41 @@ VOTable input handler.

      +
      + + +ECSV + +

      Tables can be written to the Enhanced Character Separated Values format, +described in . +Two variants of this format are currently supported, +depending on the delimiter character you want to use +(both are legal ECSV): +

      +
      ecsv-space
      +

      ECSV using the space character as a delimiter +

      +
      ecsv-comma
      +

      ECSV using the comma character as a delimiter +

      +
      +

      + +
      + + +Feather + +

      The Feather format is described in . +Not all column types are supported by feather, +in particular if you attempt to write a table containing +array-valued columns (except for byte arrays), +those columns will be omitted from the output. +

      + +

      This writer is currently somewhat experimental; +please report problems if you experience them. +

      @@ -4924,7 +5075,8 @@ machine's 'heap memory' or into the physical memory of the machine. As a rule of thumb, the program will work at reasonable speed with tables up to about 1-10 million rows, depending on the machine -it's running on. +it's running on. It may well work work with hundreds of millions +of rows, but performance may be more sluggish. The number of columns is less of an issue, though see below concerning performance.

      @@ -4941,12 +5093,13 @@
      Increase Java's heap memory

      When a Java program runs, it has a fixed maximum amount of memory that it will use; Java does not really make use of virtual memory. - The default maximum is typically 64Mb, though that depends on your - java setup. You can increase this by + The default amount depends on your machine and java implementation. + You can increase this by using the -Xmx flag, followed by the maximum heap memory, - for instance "topcat -Xmx256M" or - "java -Xmx256M -jar topcat-full.jar". - Don't forget the "M" to indicate megabytes. + for instance "topcat -Xmx1000M" or + "java -Xmx1000M -jar topcat-full.jar". + Don't forget the "M" to indicate megabytes + or "G" for gigabytes. It's generally reasonable to increase this value up to nearly the amount of free physical memory in your machine if you need to (taking account of the needs of other processes running at the same time) @@ -4973,6 +5126,7 @@ (see ). As well as speeding things up, using FITS files will also reduce the need to use -Xmx flags as above. + Feather format also has the same advantages.

      Run in 64-bit mode
      @@ -4997,6 +5151,7 @@ which require all the cells in all the rows (for instance, calculating row statistics) may be somewhat slower using this format. + Feather format is also column-oriented.

      It is also possible to use column-oriented storage for non-FITS files by specifying the flag -Dstartable.storage=sideways. @@ -5037,7 +5192,7 @@

      - + Examples @@ -5814,6 +5969,11 @@ on 3D axes using spherical polar coordinates.

      +
      &IMG.PLOT2_TIME; Time Plot
      +

      Displays a window with special features for plotting + data which has a time coordinate. +

      +

      @@ -5854,13 +6014,6 @@

      -
      &IMG.SAMP; SAMP Window
      -

      Displays a window which displays detail about the current - status, and allows configuration, of SAMP messaging - (see ). Note this button will not be - visible if TOPCAT is running in PLASTIC mode. -

      -
      &IMG.FUNCTION; Available Functions

      Displays a window containing all the functions which can be used for writing algebraic expressions (see ). @@ -5967,16 +6120,8 @@ The ones marked "(old)" are the plotting windows that were available before TOPCAT version 4; they have a different user interface, are generally less powerful, and are somewhat deprecated, but still work. -The other non-toolbar options are somewhat experimental. -Items available from this menu and not the toolbar are:

      -
      &IMG.PLOT2_TIME; Time Plot
      -

      Displays the Time Plot window - for plotting time series data. - This is currently experimental and lacks some useful features. -

      -
      &IMG.HISTOGRAM; Histogram Plot (old)

      Displays the old-style Histogram window for plotting 1-d histograms. @@ -6112,8 +6257,36 @@

      The menu contains options relevant to -tool interoperability (SAMP or PLASTIC). These items are available -elsewhere on the toolbar or menu. +SAMP (or possibly PLASTIC) tool interoperability; +see : + +

      +
      &IMG.SAMP; SAMP Window
      +

      Pops up the SAMP Window + which displays detail about the current status, + and allows configuration, of SAMP messaging. + Note this option will not be + available if TOPCAT is running in PLASTIC mode. +

      + +
      &IMG.NO_HUB; Stop Internal Hub
      +

      By default, when TOPCAT starts up, it will look for a SAMP hub, + and if none appears to be running it will start one internally, + which will normally run until TOPCAT exits. + This is usually not problematic, but if you would prefer to run a + hub external to TOPCAT, then you may need to shut down TOPCAT's before + starting a new one. Using this option shuts down TOPCAT's internal hub. +

      + +
      &IMG.BROADCAST; Broadcast Table
      +

      Broadcasts the currently selected table to all listening applications + using SAMP.

      + +
      &IMG.SEND; Send Table to ...
      +

      Sends the currently selected table to a selected listening application + using SAMP. Select the desired recipient application from the + submenu.

      +

      @@ -7275,7 +7448,7 @@ are described in the later subsections.

      -

      Six plot windows are currently available (one is experimental): +

      Six plot windows are currently available:

      • &IMG.PLOT2_HISTOGRAM; Histogram Plot
      • @@ -7283,8 +7456,7 @@
      • &IMG.PLOT2_SKY; Sky Plot
      • &IMG.PLOT2_CUBE; Cube Plot
      • &IMG.PLOT2_SPHERE; Sphere Plot
      • -
      • &IMG.PLOT2_TIME; Time Plot - (experimental)
      • +
      • &IMG.PLOT2_TIME; Time Plot
      More may be introduced in future releases.

      @@ -8771,7 +8943,7 @@

      Zone Suffixes

      Determines how suffixes assigned to different plot zones are labelled. - Currently, plot zones are only used in the experimental + Currently, plot zones are an experimental feature used only in the Time Plot Window, so this option does not appear in most plot types. The options are as described for the Layer Suffix selector above. @@ -9284,6 +9456,11 @@ for the 3-dimensional Cartesian triples.

      +

      In some cases, for instance EPN-TAP tables with bounding boxes +in sky plots, positions will be filled in automatically. +You can of course change these default selections. +

      +
      Form tab of Quad Position layer control @@ -9602,6 +9779,157 @@ + +Area Layer Control + +

      The layer control (&IMG.PLOT_AREA;) +allows you to plot a two-dimensional shape from each row of a table. +This might typically be something like an instrument coverage footprint +corresponding to an observation. +The shape may be specified in various different ways: +as an STC-S region specification string +(as found for instance in the s_region column of +ObsCore or EPN-TAP query results), +as an array specification of polygons or circles, +or as an ASCII-encoded MOC. +You can add one of these controls to the stack by using the + (&IMG.ADD_PLOT_AREA;) button +in the control panel toolbar +or the corresponding item in the menu +for suitable plot types +(Plane, + Sky or + Sphere). +

      + +

      Areas specified in this way are generally intended +for displaying relatively small shapes such as instrument footprints. +Larger areas may also be specified, but there may be issues with use, +for instance auto-determination of the initial plot region +may not work so well, and the rendering of shapes that are +large relative to the sky may be inaccurate. +These issues may be addressed in future releases. +

      + +
      +Sky Plot Window with an Area control + +
      + +

      This control is a Table Data control as described in +. That section explains the + tab; +the and tabs +are described in more detail below. +

      + +
      +Position tab of Area layer control, for Sky Plot + +
      + +

      In the tab, you just need to +select the input table using the selector, +and then supply the expression for the region specification +in the selector. +This area value will typically be a table column containing the relevant +information, for instance the column +in tables resulting from an ObsCore or EPN-TAP query. +However, it's also possible to enter a suitable expression, +for instance "array(RA,DEC,RADIUS)" if you want +to specify a CIRCLE-format shape given position and radius +columns in the table. +

      + +

      The area may be specified in various formats, currently: + +

      +
      STC-S
      +

      Region description using STC-S syntax; see + TAP 1.0, + section 6. Note there are currently some restrictions: + <frame>, <refpos> and + <flavor> metadata are ignored, + polygon winding direction is ignored (small polygons are assumed) + and the INTERSECTION and NOT + constructions are not supported. + The non-standard MOC construction is supported. +

      +
      POLYGON
      +

      2N-element array (x1,y1, x2,y2, ..., xN,yN); + a NaN,NaN pair can be used to delimit distinct polygons. +

      +
      CIRCLE
      +

      3-element array (x,y,r). +

      +
      POINT
      +

      2-element array (x,y) +

      +
      MOC-ASCII
      +

      Region description using ASCII MOC syntax; see + MOC 1.1 + section 2.3.2. + Note there are currently a few issues with MOC plotting, + especially for large tiles. +

      +
      + +The selector to the right of the selector defines +which of these formats the selected value or expression will be +understood as. +TOPCAT tries to guess the right value when the Area selector is +filled in; if it guesses wrong, you should select the correct +option manually. If the Area value is changed, it will update +the guess accordingly; if you don't want it to do that, use the + (&IMG.LOCK;) button to stop it happening. +

      + +
      +Form tab of Area layer control + +
      + +

      The tab lets you define how the specified +region data will be plotted. +The list on the left gives a list of forms currently being plotted, +and the panel on the right shows the detailed configuration for the +currently selected form. +

      + +

      The following forms are currently available for the Area plot: +

        +
      • &IMG.FORM_AREA; Area: + draws an outlined or filled area
      • +
      • &IMG.FORM_MARK; Central: + plots the central point of an area
      • +
      • &IMG.PLOT_AREALABEL; AreaLabel: + adds a text label near the center of an area
      • +
      +It can be useful to have multiple instances of the form, +for instance to paint the outline and fill the interior separately. +The and forms +just plot points/text in the same way as +Mark/Label, +but they work with an Area coordinate rather than normal positional ones. +

      +

      You can add a new form using the &IMG.ADD; button. +Each such form can be configured separately using a panel +divided into two parts: +

      +
      Shading
      +

      The shading mode controls how points are shaded based on their + chosen colour. The various options are described in . + Depending on the mode there may be more settings to fill in here. +

      +
      Global/Subset Styles
      +

      Controls the style details for the chosen form; + see . +

      +
      +

      + +
      + Spectrogram Layer Control @@ -9613,7 +9941,7 @@

      The (&IMG.PLOT_SPECTRO;) plots a spectrum at successive (usually, but not necessarily, regularly-spaced) points in a time series. -It is only available for the experimental +It is only available for the Time Plot Window.

      @@ -9676,8 +10004,9 @@

      The layer control (&IMG.PLOT_FUNCTION;) is only available for the -Plane and -Histogram plots. +Plane, +Histogram and +Time plots. Use the menu item or corresponding toolbar button to add an instance to the control stack.

      @@ -10197,12 +10526,12 @@
      Shading Mode

      See .

      -
      Delta Longitude
      +
      Delta Lon(*)

      Change in the longitude coordinate represented by the plotted vector. The supplied value is (if not auto-scaled) an angle in degrees, and is considered to be premultiplied by cos(Latitude).

      -
      Delta Latitude
      +
      Delta Lat

      Change in the latitude coordinate represented by the plotted vector. The supplied value is (if not auto-scaled) an angle in degrees.

      @@ -10904,9 +11233,9 @@
      -Text Label Form +Label Form -

      The form (&IMG.PLOT_LABEL;) +

      The form (&IMG.PLOT_LABEL;) draws a text label by each point position.

      @@ -10916,7 +11245,7 @@
      -Text Label form configuration panel +Label form configuration panel
      @@ -11049,6 +11378,9 @@ performing the contour determination. If set too low the contours will be too crinkly, and if too high they will lose definition.

      +
      Thickness
      +

      The thickness in pixels of contour lines. +

      Scaling

      How the smoothed density is treated before the contours levels are determined. Options are linear, logarithmic and equal area. @@ -12324,6 +12656,22 @@ It may be necessary to unset it when filling polygons that may be re-entrant.

      +
      Minimal Size
      +

      Defines a threshold size in pixels below which, + instead of the shape defined by the polygon coordinates, + a replacement marker will be painted instead. + If this is set to zero, then only the shape itself + will be plotted, which may mean it appears as only a single pixel. + By setting a larger value, you can ensure that + the position of even small polygons is easily visible, + at the expense of giving them an artificial shape and size. + This value also defines the size of the replacement markers. +

      +
      Minimal Shape
      +

      Selects the shape of replacement markers that get plotted + instead of very small polygons, as controlled by the + setting. +

      @@ -12368,6 +12716,182 @@ + +Area Form + +

      The form (&IMG.FORM_AREA;) +is available from the +Area layer control, +and outlines or fills areas that are defined in a table row. +

      + +
      +Example Area plot + +
      + +
      +Area form configuration panel + +
      + +

      Configuration options are: +

      +
      Shading Mode
      +

      See . +

      +
      Polygon Mode
      +

      Defines how the polygon is drawn. Options are +

        +
      • outline: + draws a line round the outside of the polygon
      • +
      • fill: + fills the interior of the polygon
      • +
      • cross: + draws a line round the outside of the polygon + and lines between all the vertices
      • +
      +

      +
      Fast
      +

      Determines whether speed is favoured over accuracy + when drawing polygons. + In some cases unchecking this will give visually better results, + and in some cases checking it will speed up plotting. + In other cases, the setting will make no difference to either. + It may be necessary to unset it when filling shapes that + may be re-entrant. +

      +
      Minimal Size
      +

      Defines a threshold size in pixels below which, + instead of the shape defined by the Area coordinate, + a replacement marker will be painted instead. + If this is set to zero, then only the shape itself + will be plotted, which may mean it appears as only a single pixel. + By setting a larger value, you can ensure that + the position of even small areas is easily visible, + at the expense of giving them an artificial shape and size. + This value also defines the size of the replacement markers. +

      +
      Minimal Shape
      +

      Selects the shape of replacement markers that get plotted + instead of very small areas, as controlled by the + setting. +

      +
      +

      + +
      + + +Central Form + +

      The form (&IMG.FORM_MARK;) +is available from the +Area layer control, +and plots a point at the nominal center of the given area. +The effect is just the same as for the Mark form, +but it can be used from the Area layer control rather than +having to specify positional coordinates separately. +The plotted position is determined by the plotting code from the +shape information; it may or may not correspond to the shape's actual center. +

      + +
      +Example Central plot + +
      + +
      +Central form configuration panel + +
      + +

      Configuration options are: +

      +
      Shading Mode
      +

      See . +

      +
      Shape
      +

      Marker shape from a list of options. +

      +
      Size
      +

      Marker size in pixels. +

      +
      +

      + +
      + + +AreaLabel Form + +

      The form (&IMG.PLOT_AREALABEL;) +is available from the +Area layer control, +and draws a text label near the nominal center of each plotted area. +The effect is just the same as for the Label form, +but it can be used from the Area layer control rather than +having to specify positional coordinates separately. +The plotted position is determined by the plotting code from the +shape information; it may or may not correspond to the shape's actual center. +

      + +
      +Example AreaLabel plot + +
      + +
      +AreaLabel form configuration panel + +
      + +

      The configuration options are: +

      +
      Text
      +

      A column or expression from the table supplying the text to + write on the plot. Any data type (string or numeric) is permitted. +

      +
      Text Syntax
      +

      How to turn the text into characters on the screen. + and both take the + text at face value, but Antialias smooths the characters. + Antialiased text usually looks nicer, but can be perceptibly slower to plot. + At time of writing, on MacOS antialiased text seems to be required to + stop the writing coming out upside-down for non-horizontal text. + interprets the text as LaTeX source code + and typesets it accordingly. +

      +
      Font Size
      +

      Size of the font in points. +

      +
      Font Style
      +

      Style of the font - standard, serif or monospaced. +

      +
      Font Weight
      +

      Whether the font is plain, bold or italic. +

      +
      Anchor
      +

      The position of the text relative to the data position. +

      +
      Spacing Threshold
      +
      Crowding Limit
      +

      These two options control how closely spaced labels can be. + Labels which are too closely crowded together will simply not be shown, + since overplotting many labels together ends up with them being illegible. + The slider controls the smallest + area that a group of labels can have to themselves - if there are too + many in the same area, none will be drawn. Sliding it left allows more + crowding and right allows less. The + controls the largest number of labels that can be in a group. + Setting it to 2 for instance is useful if you want to see pairs of + labels, even if the pair is close. +

      +
      +

      + +
      + @@ -13153,6 +13677,12 @@
    4. &FORM.link2;
    5. &FORM.mark2;
    6. +
    7. &CONTROL.area;, with the following plot controls: +
        +
      • &FORM.area;
      • +
      • &FORM.central;
      • +
      • &FORM.arealabel;
      • +
    8. &CONTROL.quad;, with the following plot controls:
      • &FORM.poly4;
      • @@ -13466,6 +13996,12 @@
      • &FORM.link2;
      • &FORM.mark2;
    9. +
    10. &CONTROL.area;, with the following plot controls: +
        +
      • &FORM.area;
      • +
      • &FORM.central;
      • +
      • &FORM.arealabel;
      • +
    11. &CONTROL.quad;, with the following plot controls:
      • &FORM.poly4;
      • @@ -14097,6 +14633,12 @@
      • &FORM.link2;
      • &FORM.mark2;
    12. +
    13. &CONTROL.area;, with the following plot control: +
        +
      • &FORM.area;
      • +
      • &FORM.central;
      • +
      • &FORM.arealabel;
      • +
    14. &CONTROL.quad;, with the following plot controls:
      • &FORM.poly4;
      • @@ -14338,10 +14880,6 @@ Time Plot Window -

        This plot window is experimental and lacks some useful features. -The details of the user interface may be changed in future versions. -

        -
        @@ -14349,13 +14887,45 @@

        The (&IMG.PLOT2_TIME;) is intended for plotting time series data. -You can find it in the Graphics -menu of the main Control Window, but since it is currently -experimental it does not appear in the main toolbar.

        -

        The horizontal axis represents time, and can be labelled accordingly, -and the window can display functions of time, scatter plots and spectrograms. +

        The horizontal axis represents time, and can be labelled accordingly +(for instance in minutes, hours, days, months and years), +and the window can display appropriate types of plot including spectrograms. +

        + +

        To define the time coordinate, use the selector +in position tabs as usual. +Note however that this contains a selector +on the right hand side that indicates how the selected quantity +will be interpreted as a time value. +The options are: +

          +
        • : + Years since 0AD +
        • +
        • : + Modified Julian Date (days since 17 Nov 1858) +
        • +
        • : + Julian Day (days since 1 Jan 4713 BC) +
        • +
        • : + Seconds since midnight 1 Jan 1970 +
        • +
        • : + ISO 8601 date-time string +
        • +
        +If the input table contains suitable metadata, +for instance in a CDF file or a TIMESYS-bearing VOTable 1.4, +additional options may be available that are taken from +information in the table. +TOPCAT will make a guess at the correct format to use, +but if it gets it wrong you can set the format selector manually. +The format selector is updated to the best guess when you choose +a new Time value; if you want to stop it doing that, use the +Lock button (&IMG.LOCK;).

        Unlike the other plot windows (at time of writing) the Time plot @@ -14363,6 +14933,8 @@ Zones stacked vertically on top of each other, so that different plots share a time axis but have their own Y axis. +Note: This multi-zone feature is somewhat experimental, +and the user interface may change in future versions.

        The Time Plot offers the following plot controls: @@ -19955,6 +20527,19 @@ Send FITS Image.

        +

        TOPCAT supports two different (and incompatible) +major versions of the SIA protocol, SIA version 1 and version 2. +When you have selected a service to use, its protocol version number +is displayed in the indicator next to +the display. +If you have entered the URL manually, you will need to make sure +this is set to the appropriate value. +Note that, although SIAv2 allows a number of query +possibilities not offered by SIAv1, +at present TOPCAT does not support this additional functionality +for SIAv2 services. +

        + @@ -19981,6 +20566,11 @@ value intended to find nearby objects". However, experience shows that this doesn't always work, so it may be best to fill this in. +It is also permitted to leave the and +fields blank, if you don't want to restrict the search by sky position. +That may be a reasonable thing to do, for example, for services providing +theoretical rather than observed spectra, or if you want all the data +(subject to possible service restrictions). There is additionally a selector which allows you to restrict the result to contain only spectra in certain formats. By default, the service chooses which formats to return. @@ -20124,6 +20714,19 @@ Send FITS Image.

        +

        TOPCAT supports two different (and incompatible) +major versions of the SIA protocol, SIA version 1 and version 2. +When you have selected a service to use, its protocol version number +is displayed in the indicator next to +the display. +If you have entered the URL manually, you will need to make sure +this is set to the appropriate value. +Note that, although SIAv2 allows a number of query +possibilities not offered by SIAv1, +at present TOPCAT does not support this additional functionality +for SIAv2 services. +

        +
        @@ -21890,7 +22493,7 @@
        Table Format:

        Selects the file format of the table to load. If the table is in one of the formats that TOPCAT is able to - auto-detect (VOTable, FITS, CDF) then the default value + auto-detect (VOTable, FITS, ECSV, CDF, Feather) then the default value (auto) may be used, otherwise the correct format must be chosen from the list.

        @@ -21981,7 +22584,7 @@
        Table Format:

        Selects the file format of the table to load. If the table is in one of the formats that TOPCAT is able to - auto-detect (VOTable, FITS, CDF) then the default value + auto-detect (VOTable, FITS, ECSV, CDF, Feather) then the default value (auto) may be used, otherwise the correct format must be chosen from the list.

        @@ -24118,10 +24721,9 @@
        • JEL (Konstantin Metlov, GNU) for algebraic expression evaluation
        • -
        • PixTools - (Nikolay Kuropatkin, Fermilab EAG) - for HEALPix-based celestial sphere row matching
        • +
        • cds-healpix-java + (F-X Pineau, CDS) for HEALPix manipulation
        • nom.tam.fits (NASA) for parts of FITS I/O
        • MOC (CDS) Multi-Order Coverage HEALPix maps for footprint manipulation
        • +
        • Snakeyaml for YAML parsing in ECSV input handler
        • JIDE Common Layer (Jidesoft) for double-ended slider controls
        • @@ -24218,6 +24822,7 @@
        • Tim Jenness (JACH)
        • JJ Kavelaars (NRC)
        • Grant Kennedy (IoA)
        • +
        • Marina Kounkel (WWU)
        • Gerard Lemson (MPE Garching)
        • Mark Mahabir (Leicester)
        • Brian Major (CADC)
        • @@ -24254,6 +24859,7 @@
        • Juande Sandander Vela (IAA-CSIC)
        • Benjamin Steltner (MPG)
        • Mike Watson (Leicester)
        • +
        • Ming Yang (Athens)
        • Ivan Zolotukhin (SAI MSU)
        • Jonathan Zwart (Columbia)
        @@ -28931,6 +29537,170 @@

    15. +

      + +
      Version 4.7-1 (5 June 2020)
      +

      +

      +
      File Formats:
      +

      +

        +
      • The (Enhanced Character Separated Values) + storage format is now supported for + input and + output.
      • +
      • The + storage format is now supported for + input and + output.
      • +
      +

      +
      Performance:
      +

      A number of implementation changes have been made + which may improve performance, particularly for crossmatching + (typical improvements for large sky crossmatches are a factor of 2, + though YMMV). These should have no effect on the results, + but if anybody notices crossmatching behaviour which is + changed since previous versions or otherwise suspicious, + please report it. +

        +
      • The HEALPix implementation has been replaced; + all HEALPix manipulation is now done using the excellent + cds-healpix-java library + written by François-Xavier Pineau from CDS, + which speeds up sky crossmatching considerably. + Many thanks to François-Xavier and to CDS + for providing this library and for assistance with its use; + thanks also to Nikolay Kuropatkin from FermiLab whose + PixTools library + served this purpose in TOPCAT up till now.
      • +
      • Rows are now binned during crossmatches + using a HashSet rather than a TreeSet.
      • +
      • Evaluations of the arcsin function in Sky matches + now use the (Apache via cds-healpix) FastMath implementation + rather than the standard J2SE version.
      • +
      • Performance is improved when reading long String values + from FITS files.
      • +
      +

      +
      Visualisation:
      +

      +

        +
      • New Area Layer Control, + offering forms + Area, + Central and + AreaLabel, + can plot region data supplied as area coordinates in the form of + STC-S (e.g. from ObsCore/EPN-TAP s_region), + DALI polygon/circle/point or (ASCII) MOC columns + on Sky, Plane or Sphere plots.
      • +
      • The Time Plot window + is no longer labelled experimental, + and now appears on the main control window toolbar. + When selecting its time coordinate, you can now also select how + input values are mapped to time (as MJD, JD, ISO-8601 etc), + which makes it much easier to plot time quantities from + input tables with insufficient metadata.
      • +
      • The default initial layer in the + Time Plot is now + Line, not + Mark.
      • +
      • Scatter plot marker size + now defaults to a value dependent on + the number of rows in the table, + so by default large tables have small markers and + small tables have larger markers.
      • +
      • Provide more options in the selector + for the Mark plot form: + versions of circle, cross etc with thicker lines.
      • +
      • Maximum marker in + Mark plot form + is increased from 5 to 9.
      • +
      • Add line thickness control to the + contour plot.
      • +
      • Improved plot axis labelling in LaTeX mode, e.g. in LaTeX write + "3x106" not "3e6".
      • +
      • The Sky Plot position layer control + now automatically selects lon/lat coordinates for EPN-TAP tables + (midLon(c1min,c1max), + midLat(c2min,c2max)) where available. + Similarly, + c{1,2}{min,max} values + are automatically used for the sky plot + Quad Position Layer Control, + so that EPN-TAP-style bounding boxes + are displayed by default.
      • +
      • Add replacement marker functionality (Minimal Size/Shape options) + to Poly4 form, + so that small polygons aren't too small to see.
      • +
      • Improve accuracy when drawing large HEALPix tile boundaries + in some cases for + SkyDensity and + Healpix + sky plot layers.
      • +
      • The Sort Axis option for the Line plotter in the Time plot + window now presents the option Time rather than X (or Y).
      • +
      • Add Center option to the Label + plot Anchor selector.
      • +
      +

      +
      Other minor enhancements/changes:
      +

      +

        +
      • Basic support for SIA version 2 as well as version 1 in the + SIA Query and + Multiple SIA Query windows.
      • +
      • It is now permitted to provide blank RA/Dec entries in the + SSA Query window. + This is legal according to the SSA standard and reasonable for + e.g. theory services.
      • +
      • Remove button from main + Control Window toolbar for reasons of space; + this option is still available in the + menu.
      • +
      • Add new functions midLon and midLat + to Sky class.
      • +
      • Add new conversion functions *ToUnixSec to + Times class.
      • +
      • Adjust coordinate labels for + SkyVector plot form, + to make it more obvious that cos(lat) premultiplication + is required for Delta Lon.
      • +
      • Reorder registry service URLs for the (largely obsolete) + RI1.0-mode registry search in the + Registry Search Panel. + Default is now Euro-VO, which still offers a working RI1.0 + service; the (moribund?) AstroGrid services are demoted.
      • +
      +

      +
      Bug and misfeature fixes:
      +

      +

        +
      • Fix Ellipse mode in the Plane Plot's + Draw Algebraic Subset action; + the ellipse expression was previously covering an area + 2-0.5 smaller than the drawing.
      • +
      • Fix polygon plot form in + Sphere Plot; this + combination was failing to plot anything, now it works.
      • +
      • FITS ASCII table extensions with TFORM values of In + are now treated as 64-bit integers for n>=10 + rather than n>10.
      • +
      • Fix regression bug since last release that refused to make + dataless plots.
      • +
      • Slightly improve plot axis labelling for small numbers; + remove unnecessary decimal point in scientific notation + in some cases.
      • +
      • Fix fairly harmless NullPointerException report when + displaying a blank plot with too few auto-selected axes + (regression).
      • +
      +

      +

      diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/AbstractSubsetQueryWindow.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/AbstractSubsetQueryWindow.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/AbstractSubsetQueryWindow.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/AbstractSubsetQueryWindow.java 2020-06-04 17:10:04.000000000 +0000 @@ -14,11 +14,10 @@ * @author Mark Taylor * @since 28 Sep 2006 */ -@SuppressWarnings("rawtypes") public abstract class AbstractSubsetQueryWindow extends QueryWindow { private final TopcatModel tcModel_; - private final JComboBox nameSelector_; + private final JComboBox nameSelector_; private final JTextField exprField_; /** @@ -62,14 +61,6 @@ * @param name subset name */ public void setSelectedName( String name ) { - for ( int i = 0; i < nameSelector_.getItemCount(); i++ ) { - Object item = nameSelector_.getItemAt( i ); - RowSubset rset = (RowSubset) item; - if ( rset.getName().equals( name ) ) { - nameSelector_.setSelectedItem( rset ); - return; - } - } nameSelector_.setSelectedItem( name ); } @@ -101,14 +92,7 @@ JOptionPane.ERROR_MESSAGE ); return false; } - - /* The item selected in the name selector will either be a string - * or an existing RowSubset from the subsets list belonging to - * the tcModel. Get the name as a string either way. */ - assert selected instanceof RowSubset || selected instanceof String; - String name = selected instanceof RowSubset - ? ((RowSubset) selected).getName() - : selected.toString(); + String name = selected.toString(); /* Try to construct a synthetic row subset as requested. */ SyntheticRowSubset exprSubset; diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/ActivationWindow.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/ActivationWindow.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/ActivationWindow.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/ActivationWindow.java 2020-06-04 17:10:04.000000000 +0000 @@ -76,11 +76,10 @@ * @author Mark Taylor * @since 21 Dec 2017 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class ActivationWindow extends AuxWindow { private final TopcatModel tcModel_; - private final DefaultListModel listModel_; + private final DefaultListModel listModel_; private final BasicCheckBoxList list_; private final JComponent configContainer_; private final JComponent outputContainer_; @@ -143,8 +142,7 @@ final Color enabledFg = UIManager.getColor( "Label.foreground" ); final Color disabledFg = UIManager.getColor( "Label.disabledForeground" ); - list_ = new BasicCheckBoxList( ActivationEntry.class, - true ) { + list_ = new BasicCheckBoxList( true ) { @Override protected void configureEntryRenderer( JComponent entryRenderer, ActivationEntry item, @@ -177,7 +175,7 @@ updateActivations(); } }; - listModel_ = (DefaultListModel) list_.getModel(); + listModel_ = list_.getModel(); list_.setSelectionMode( ListSelectionModel.SINGLE_SELECTION ); JComponent listContainer = new JPanel( new BorderLayout() ); @@ -536,8 +534,7 @@ int nEnabled = 0; int nActive = 0; for ( int i = 0; i < listModel_.getSize(); i++ ) { - ActivationEntry entry = - (ActivationEntry) listModel_.getElementAt( i ); + ActivationEntry entry = listModel_.getElementAt( i ); if ( entry.getConfigurator().getActivator() != null ) { nEnabled++; if ( list_.isChecked( entry ) ) { @@ -625,7 +622,7 @@ } } if ( selected == null && listModel_.getSize() == 0 ) { - selected = (ActivationEntry) listModel_.getElementAt( 0 ); + selected = listModel_.getElementAt( 0 ); } list_.setSelectedValue( selected, true ); updateSelection(); @@ -720,7 +717,8 @@ * @return index of entry in model, * or -1 if not found */ - private int getEntryIndex( ListModel model, ActivationEntry entry ) { + private int getEntryIndex( ListModel model, + ActivationEntry entry ) { int n = model.getSize(); for ( int i = 0; i < n; i++ ) { if ( model.getElementAt( i ) == entry ) { diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/BrowserActivationType.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/BrowserActivationType.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/BrowserActivationType.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/BrowserActivationType.java 2020-06-04 17:10:04.000000000 +0000 @@ -45,11 +45,10 @@ /** * Implementation that displays a URL in a general purpose web browser. */ - @SuppressWarnings({"unchecked","rawtypes"}) private static class BrowserColumnConfigurator extends UrlColumnConfigurator { - private final JComboBox mapperChooser_; - private final JComboBox browserChooser_; + private final JComboBox mapperChooser_; + private final JComboBox browserChooser_; private static final String WEBMAPPER_KEY = "webMapper"; private static final String BROWSER_KEY = "browser"; @@ -64,13 +63,13 @@ new ColFlag[] { ColFlag.HTML, ColFlag.WEBREF, ColFlag.URL, } ); setLocationLabel( "Resource Identifier" ); - mapperChooser_ = new JComboBox(); + mapperChooser_ = new JComboBox<>(); for ( WebMapper mapper : WebMapper.getMappers() ) { mapperChooser_.addItem( mapper ); } mapperChooser_.addActionListener( getActionForwarder() ); - browserChooser_ = new JComboBox(); + browserChooser_ = new JComboBox<>(); for ( Browser b : browsers ) { browserChooser_.addItem( b ); } @@ -84,9 +83,9 @@ protected Activator createActivator( ColumnData cdata ) { final WebMapper mapper = - (WebMapper) mapperChooser_.getSelectedItem(); + mapperChooser_.getItemAt( mapperChooser_.getSelectedIndex() ); final Browser browser = - (Browser) browserChooser_.getSelectedItem(); + browserChooser_.getItemAt( browserChooser_.getSelectedIndex() ); final String label = getWindowLabel( cdata ); return new LocationColumnActivator( cdata, false ) { protected Outcome activateLocation( String loc, long lrow ) { diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/ConfigState.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/ConfigState.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/ConfigState.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/ConfigState.java 2020-06-04 17:10:04.000000000 +0000 @@ -32,7 +32,6 @@ * @author Mark Taylor * @since 30 Apr 2018 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class ConfigState { private final Map map_; @@ -153,7 +152,7 @@ * @param key entry key * @param selector selection component containing state */ - public void saveSelection( String key, JComboBox selector ) { + public void saveSelection( String key, JComboBox selector ) { String sval = getStringValue( selector ); if ( sval != null ) { map_.put( key, getStringValue( selector ) ); @@ -166,7 +165,7 @@ * @param key entry key * @param selector selection component to be updated with state */ - public void restoreSelection( String key, JComboBox selector ) { + public void restoreSelection( String key, JComboBox selector ) { if ( map_.containsKey( key ) ) { String value = map_.get( key ); int ix = getSelectorIndex( selector, value ); @@ -203,7 +202,7 @@ * @param selector combo box * @return string representation of current selection, or null */ - private static String getStringValue( JComboBox selector ) { + private static String getStringValue( JComboBox selector ) { Object item = selector.getSelectedItem(); if ( item == null ) { return ""; @@ -212,8 +211,10 @@ return (String) item; } int index = selector.getSelectedIndex(); - ListCellRenderer renderer = selector.getRenderer(); - JList jlist = new JList(); + @SuppressWarnings("unchecked") + ListCellRenderer renderer = + (ListCellRenderer) selector.getRenderer(); + JList jlist = new JList(); Component rendered = renderer.getListCellRendererComponent( jlist, item, index, false, false ); @@ -233,7 +234,8 @@ * @param svalue required string value * @return index of selection in combo box, or -1 if not found */ - private static int getSelectorIndex( JComboBox selector, String svalue ) { + private static int getSelectorIndex( JComboBox selector, + String svalue ) { int nitem = selector.getItemCount(); if ( svalue == null || svalue.length() == 0 ) { for ( int i = 0; i < nitem; i++ ) { @@ -247,8 +249,10 @@ return i; } } - ListCellRenderer renderer = selector.getRenderer(); - JList jlist = new JList(); + @SuppressWarnings("unchecked") + ListCellRenderer renderer = + (ListCellRenderer) selector.getRenderer(); + JList jlist = new JList(); for ( int i = 0; i < nitem; i++ ) { Object item = selector.getItemAt( i ); Component rendered = diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/CutoutActivationType.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/CutoutActivationType.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/CutoutActivationType.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/CutoutActivationType.java 2020-06-04 17:10:04.000000000 +0000 @@ -22,7 +22,6 @@ * of cutout services. * This is primitive: the data services are old, there are not many * of them, and the viewing application is not configurable. - * It should be replaced (by something SkyView-based?). * * @author Mark Taylor * @since 29 Mar 2018 @@ -75,11 +74,10 @@ /** * Configurator for use with CutoutActivationType. */ - @SuppressWarnings({"unchecked","rawtypes"}) private static class CutoutConfigurator extends SkyPosConfigurator { private final TopcatModel tcModel_; - private final JComboBox serviceSelector_; + private final JComboBox serviceSelector_; private final IntSelector npixSelector_; private final JLabel pixsizeLabel_; private static final String SERVICE_KEY = "service"; @@ -94,7 +92,7 @@ super( tinfo ); tcModel_ = tinfo.getTopcatModel(); ActionForwarder forwarder = getActionForwarder(); - serviceSelector_ = new JComboBox( SERVICES ); + serviceSelector_ = new JComboBox<>( SERVICES ); serviceSelector_.addActionListener( forwarder ); npixSelector_ = new IntSelector( new int[] { 25, 50, 75, 100, 150, 200, 300, 400, 500, @@ -165,7 +163,8 @@ * Returns the currently selected cutout service. */ private CutoutService getSelectedService() { - return (CutoutService) serviceSelector_.getSelectedItem(); + return serviceSelector_ + .getItemAt( serviceSelector_.getSelectedIndex() ); } } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/GenericViewImageActivationType.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/GenericViewImageActivationType.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/GenericViewImageActivationType.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/GenericViewImageActivationType.java 2020-06-04 17:10:04.000000000 +0000 @@ -18,6 +18,7 @@ import uk.ac.starlink.sog.SOGNavigatorImageDisplay; import uk.ac.starlink.sog.SOGNavigatorImageDisplayFrame; import uk.ac.starlink.table.ColumnData; +import uk.ac.starlink.topcat.ColumnDataComboBox; import uk.ac.starlink.topcat.ColumnDataComboBoxModel; import uk.ac.starlink.topcat.ImageWindow; import uk.ac.starlink.topcat.LineBox; @@ -74,12 +75,11 @@ /** * Configurator implementation for URLs pointing to images. */ - @SuppressWarnings({"unchecked","rawtypes"}) private static class ImageColumnConfigurator extends UrlColumnConfigurator { final TopcatModel tcModel_; final boolean isRegion_; final boolean hasViewerChoice_; - final JComboBox viewerSelector_; + final JComboBox viewerSelector_; final NumberSelector xoffSelector_; final NumberSelector yoffSelector_; @@ -104,7 +104,7 @@ JComponent queryPanel = getQueryPanel(); ActionListener forwarder = getActionForwarder(); - viewerSelector_ = new JComboBox( viewers ); + viewerSelector_ = new JComboBox( viewers ); viewerSelector_.addActionListener( forwarder ); xoffSelector_ = new NumberSelector( tcModel_, "X Offset" ); xoffSelector_.comboBox_.addActionListener( forwarder ); @@ -164,7 +164,8 @@ return getViewer().getSafety(); } private Viewer getViewer() { - return (Viewer) viewerSelector_.getSelectedItem(); + return viewerSelector_ + .getItemAt( viewerSelector_.getSelectedIndex() ); } } @@ -473,11 +474,10 @@ /** * Component for choosing a numeric table column. */ - @SuppressWarnings({"unchecked","rawtypes"}) private static class NumberSelector { final String label_; final ColumnDataComboBoxModel model_; - final JComboBox comboBox_; + final JComboBox comboBox_; /** * Constructor. @@ -489,7 +489,7 @@ label_ = label; model_ = new ColumnDataComboBoxModel( tcModel, Number.class, false ); - comboBox_ = ColumnDataComboBoxModel.createComboBox(); + comboBox_ = new ColumnDataComboBox(); comboBox_.setModel( model_ ); } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/LoadTableActivationType.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/LoadTableActivationType.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/LoadTableActivationType.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/LoadTableActivationType.java 2020-06-04 17:10:04.000000000 +0000 @@ -59,8 +59,7 @@ */ private static class TableColumnConfigurator extends UrlColumnConfigurator { private final ControlWindow controlWindow_; - @SuppressWarnings("rawtypes") - private final JComboBox formatSelector_; + private final JComboBox formatSelector_; private final JCheckBox multipleSelector_; private final JCheckBox paramsSelector_; private final JCheckBox allowsysSelector_; @@ -118,7 +117,8 @@ protected Activator createActivator( ColumnData cdata ) { final StarTableFactory tfact = controlWindow_.getTableFactory(); - final String format = (String) formatSelector_.getSelectedItem(); + final String format = + formatSelector_.getItemAt( formatSelector_.getSelectedIndex() ); final boolean isSelect = false; final boolean isMultiple = multipleSelector_.isSelected(); final boolean importParams = paramsSelector_.isSelected(); diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/PlotTableActivationType.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/PlotTableActivationType.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/PlotTableActivationType.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/PlotTableActivationType.java 2020-06-04 17:10:04.000000000 +0000 @@ -9,6 +9,7 @@ import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; +import javax.swing.ListCellRenderer; import javax.swing.SwingUtilities; import javax.swing.plaf.basic.BasicComboBoxRenderer; import uk.ac.starlink.table.ColumnData; @@ -57,12 +58,11 @@ /** * Configurator for use with this class. */ - @SuppressWarnings({"unchecked","rawtypes"}) private static class PlotColumnConfigurator extends UrlColumnConfigurator { private final StarTableFactory tfact_; private TablePlotDisplay plotDisplay_; - private final JComboBox formatSelector_; - private final JComboBox ptypeSelector_; + private final JComboBox formatSelector_; + private final JComboBox ptypeSelector_; private final JCheckBox paramsSelector_; private final JCheckBox allowsysSelector_; private static final String FORMAT_KEY = "format"; @@ -80,22 +80,23 @@ tfact_ = ControlWindow.getInstance().getTableFactory(); JComponent queryPanel = getQueryPanel(); ActionForwarder forwarder = getActionForwarder(); - ptypeSelector_ = new JComboBox( PlotWindowType.values() ); + ptypeSelector_ = new JComboBox<>( PlotWindowType.values() ); ptypeSelector_.setSelectedItem( PlotWindowType.PLANE ); - ptypeSelector_.setRenderer( new BasicComboBoxRenderer() { + final BasicComboBoxRenderer baseRenderer = + new BasicComboBoxRenderer(); + ptypeSelector_.setRenderer( new ListCellRenderer() { @Override - public Component - getListCellRendererComponent( JList list, Object value, - int index, boolean isSel, - boolean hasFocus ) { + public Component getListCellRendererComponent( + JList list, + PlotWindowType value, + int index, boolean isSel, boolean hasFocus ) { Component c = - super.getListCellRendererComponent( list, value, index, - isSel, hasFocus ); - if ( c instanceof JLabel && - value instanceof PlotWindowType ) { + baseRenderer + .getListCellRendererComponent( list, value, index, + isSel, hasFocus ); + if ( c instanceof JLabel ) { JLabel label = (JLabel) c; - ((JLabel) c).setIcon( ((PlotWindowType) value) - .getIcon() ); + ((JLabel) c).setIcon( value.getIcon() ); } return c; } @@ -125,7 +126,8 @@ } protected Activator createActivator( ColumnData cdata ) { - final String format = (String) formatSelector_.getSelectedItem(); + final String format = + formatSelector_.getItemAt( formatSelector_.getSelectedIndex() ); final boolean importParams = paramsSelector_.isSelected(); final boolean allowSystem = allowsysSelector_.isSelected(); PlotWindowType ptype = diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/SampSender.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/SampSender.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/SampSender.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/SampSender.java 2020-06-04 17:10:04.000000000 +0000 @@ -34,14 +34,13 @@ * @author Mark Taylor * @since 27 Mar 2018 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class SampSender { private final String mtype_; private final SampCommunicator communicator_; private final GuiHubConnector connector_; private final SendManager sendManager_; - private final ListModel clientListModel_; + private final ListModel clientListModel_; private int timeoutSec_; /** @@ -66,11 +65,11 @@ communicator_ = null; connector_ = null; sendManager_ = null; - clientListModel_ = new AbstractListModel() { + clientListModel_ = new AbstractListModel() { public int getSize() { return 0; } - public Object getElementAt( int i ) { + public Client getElementAt( int i ) { throw new IllegalArgumentException(); } }; @@ -95,17 +94,18 @@ * * @return listmodel containing appropriately-subscribed clients */ - public ListModel getClientListModel() { + public ListModel getClientListModel() { return clientListModel_; } /** * Returns a ComboBoxModel listing clients that are subscribed to - * this sender's MType. + * this sender's MType. It may also contain an object representing + * broadcast. * * @return client selection list */ - public ComboBoxModel getClientSelectionModel() { + public ComboBoxModel getClientSelectionModel() { return sendManager_.getComboBoxModel(); } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/SendHips2fitsActivationType.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/SendHips2fitsActivationType.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/SendHips2fitsActivationType.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/SendHips2fitsActivationType.java 2020-06-04 17:10:04.000000000 +0000 @@ -45,11 +45,10 @@ /** * Configurator for use with this class. */ - @SuppressWarnings({"unchecked","rawtypes"}) private static class SendConfigurator extends Hips2fitsConfigurator { final SampSender imageSender_; - final ListModel clientListModel_; + final ListModel clientListModel_; /** * Constructor. @@ -67,8 +66,8 @@ clientListModel_ = imageSender_.getClientListModel(); clientListModel_.addListDataListener( forwarder ); imageSender_.getConnector().addConnectionListener( forwarder ); - JComboBox viewerSelector = - new JComboBox( imageSender_.getClientSelectionModel() ); + JComboBox viewerSelector = + new JComboBox<>( imageSender_.getClientSelectionModel() ); viewerSelector.addActionListener( forwarder ); getStack().addLine( "Image Viewer", new ShrinkWrapper( viewerSelector ) ); diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/SendImageActivationType.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/SendImageActivationType.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/SendImageActivationType.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/SendImageActivationType.java 2020-06-04 17:10:04.000000000 +0000 @@ -41,10 +41,9 @@ /** * Configurator implementation for URLs pointing to FITS images. */ - @SuppressWarnings({"unchecked","rawtypes"}) private static class ImageColumnConfigurator extends UrlColumnConfigurator { final SampSender imageSender_; - final ListModel clientListModel_; + final ListModel clientListModel_; private static final String IMAGE_MTYPE = "image.load.fits"; @@ -61,8 +60,9 @@ clientListModel_ = imageSender_.getClientListModel(); clientListModel_.addListDataListener( forwarder ); imageSender_.getConnector().addConnectionListener( forwarder ); - JComboBox viewerSelector = - new JComboBox( imageSender_.getClientSelectionModel() ); + JComboBox viewerSelector = + new JComboBox( imageSender_ + .getClientSelectionModel() ); viewerSelector.addActionListener( forwarder ); getQueryPanel() .add( new LineBox( "Image Viewer", diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/SendIndexActivationType.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/SendIndexActivationType.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/SendIndexActivationType.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/SendIndexActivationType.java 2020-06-04 17:10:04.000000000 +0000 @@ -51,7 +51,6 @@ : Suitability.SUGGESTED; } - @SuppressWarnings({"unchecked","rawtypes"}) public ActivatorConfigurator createConfigurator( TopcatModelInfo tinfo ) { final SampSender rowSender = new SampSender( "table.highlight.row" ); final TopcatModel tcModel = tinfo.getTopcatModel(); @@ -64,8 +63,9 @@ /** Constructor. */ { ActionForwarder forwarder = getActionForwarder(); if ( isSelectTarget_ ) { - JComboBox clientSelector = - new JComboBox( rowSender.getClientSelectionModel() ); + JComboBox clientSelector = + new JComboBox( rowSender + .getClientSelectionModel() ); stack.addLine( "Target Client", clientSelector ); clientSelector.addActionListener( forwarder ); rowSender.getConnector().addConnectionListener( forwarder ); @@ -158,9 +158,8 @@ * * @return true iff the table has an ID or URL */ - @SuppressWarnings("rawtypes") public boolean hasPublicIdentifier() { - ListModel tableIdListModel = + ListModel tableIdListModel = sampControl_.getIdentifiableTableListModel(); int n = tableIdListModel.getSize(); for ( int i = 0; i < n; i++ ) { diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/SendSkyPosActivationType.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/SendSkyPosActivationType.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/SendSkyPosActivationType.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/SendSkyPosActivationType.java 2020-06-04 17:10:04.000000000 +0000 @@ -38,11 +38,10 @@ /** * Configurator implementation for use with this activation type. */ - @SuppressWarnings({"unchecked","rawtypes"}) private static class SendConfigurator extends SkyPosConfigurator { private final SampSender skySender_; - private final ListModel clientListModel_; + private final ListModel clientListModel_; private static final String SKY_MTYPE = "coord.pointAt.sky"; @@ -55,8 +54,8 @@ super( tinfo ); skySender_ = new SampSender( SKY_MTYPE ); clientListModel_ = skySender_.getClientListModel(); - JComboBox appSelector = - new JComboBox( skySender_.getClientSelectionModel() ); + JComboBox appSelector = + new JComboBox( skySender_.getClientSelectionModel() ); getStack().addLine( "Target Application", appSelector ); ActionForwarder forwarder = getActionForwarder(); clientListModel_.addListDataListener( forwarder ); diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/SendSpectrumActivationType.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/SendSpectrumActivationType.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/SendSpectrumActivationType.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/SendSpectrumActivationType.java 2020-06-04 17:10:04.000000000 +0000 @@ -52,12 +52,11 @@ /** * Configurator implementation for URLs pointing to (SSA) spectra. */ - @SuppressWarnings({"unchecked","rawtypes"}) private static class SpectrumColumnConfigurator extends UrlColumnConfigurator { final TopcatModel tcModel_; final SampSender specSender_; - final ListModel clientListModel_; + final ListModel clientListModel_; private static final String SPECTRUM_MTYPE = "spectrum.load.ssa-generic"; @@ -79,8 +78,8 @@ specSender_.getConnector().addConnectionListener( forwarder ); /* Set up a selector for the spectrum viewer. */ - JComboBox viewerSelector = - new JComboBox( specSender_.getClientSelectionModel() ); + JComboBox viewerSelector = + new JComboBox( specSender_.getClientSelectionModel() ); viewerSelector.addActionListener( forwarder ); getQueryPanel() .add( new LineBox( "Spectrum Viewer", diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/SendTableActivationType.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/SendTableActivationType.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/SendTableActivationType.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/SendTableActivationType.java 2020-06-04 17:10:04.000000000 +0000 @@ -40,12 +40,11 @@ /** * Configurator implementation for URLs pointing to VOTables. */ - @SuppressWarnings({"unchecked","rawtypes"}) private static class SendTableColumnConfigurator extends UrlColumnConfigurator { final TopcatModel tcModel_; final SampSender votableSender_; - final ListModel clientListModel_; + final ListModel clientListModel_; private static final String VOTABLE_MTYPE = "table.load.votable"; @@ -64,8 +63,9 @@ clientListModel_ = votableSender_.getClientListModel(); clientListModel_.addListDataListener( forwarder ); votableSender_.getConnector().addConnectionListener( forwarder ); - JComboBox viewerSelector = - new JComboBox( votableSender_.getClientSelectionModel() ); + JComboBox viewerSelector = + new JComboBox( votableSender_ + .getClientSelectionModel() ); viewerSelector.addActionListener( forwarder ); getQueryPanel() .add( new LineBox( "Table Viewer", diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/ServiceActivationType.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/ServiceActivationType.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/ServiceActivationType.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/ServiceActivationType.java 2020-06-04 17:10:04.000000000 +0000 @@ -246,10 +246,9 @@ /** * Panel for selecting a URL Invoker. */ - @SuppressWarnings({"unchecked","rawtypes"}) private static class InvokePanel extends LabelledComponentStack { private final UrlOptions urlopts_; - final JComboBox invokeSelector_; + final JComboBox invokeSelector_; /** * Constructor. @@ -259,7 +258,7 @@ InvokePanel( UrlOptions urlopts ) { urlopts_ = urlopts; UrlInvoker[] invokers = urlopts.getInvokers(); - invokeSelector_ = new JComboBox( invokers ); + invokeSelector_ = new JComboBox<>( invokers ); addLine( "Action", invokeSelector_ ); } @@ -269,7 +268,8 @@ * @return invoker */ public UrlInvoker getUrlInvoker() { - return (UrlInvoker) invokeSelector_.getSelectedItem(); + return invokeSelector_.getItemAt( invokeSelector_ + .getSelectedIndex() ); } /** @@ -289,9 +289,8 @@ /** * Panel for selecting, and displaying details of, a service. */ - @SuppressWarnings({"unchecked","rawtypes"}) private static class ServicePanel extends JPanel { - final JComboBox serviceSelector_; + final JComboBox serviceSelector_; final JTextField urlField_; final JTextField nameField_; final JTextField descripField_; @@ -306,10 +305,10 @@ */ ServicePanel( ServiceDescriptor[] sds ) { super( new BorderLayout() ); - serviceSelector_ = new RenderingComboBox( sds ) { + serviceSelector_ = new RenderingComboBox( sds ) { @Override - protected String getRendererText( Object item ) { - return getServiceLabel( (ServiceDescriptor) item ); + protected String getRendererText( ServiceDescriptor sd ) { + return getServiceLabel( sd ); } }; if ( sds.length > 0 ) { diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/UrlColumnConfigurator.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/UrlColumnConfigurator.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/activate/UrlColumnConfigurator.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/activate/UrlColumnConfigurator.java 2020-06-04 17:10:04.000000000 +0000 @@ -15,6 +15,7 @@ import uk.ac.starlink.table.ColumnData; import uk.ac.starlink.table.ColumnInfo; import uk.ac.starlink.table.gui.StarTableColumn; +import uk.ac.starlink.topcat.ColumnDataComboBox; import uk.ac.starlink.topcat.ColumnDataComboBoxModel; import uk.ac.starlink.topcat.Outcome; import uk.ac.starlink.topcat.TopcatModel; @@ -28,12 +29,11 @@ * @author Mark Taylor * @since 21 Dec 2017 */ -@SuppressWarnings({"unchecked","rawtypes"}) public abstract class UrlColumnConfigurator extends AbstractActivatorConfigurator { private final TopcatModel tcModel_; - private final JComboBox colSelector_; + private final JComboBox colSelector_; private final Box queryPanel_; private final JLabel colLabel_; private static final String URLCOL_KEY = "url"; @@ -58,7 +58,7 @@ ColumnDataComboBoxModel colModel = new ColumnDataComboBoxModel( tcModel_, String.class, true ); configureDefaultSelection( colModel, tinfo, urlFlags ); - colSelector_ = ColumnDataComboBoxModel.createComboBox(); + colSelector_ = new ColumnDataComboBox(); colSelector_.setModel( colModel ); colSelector_.addActionListener( getActionForwarder() ); colLabel_ = new JLabel( urlWord + " Location: " ); diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/BasicCheckBoxList.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/BasicCheckBoxList.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/BasicCheckBoxList.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/BasicCheckBoxList.java 2020-06-04 17:10:04.000000000 +0000 @@ -18,24 +18,32 @@ * @author Mark Taylor * @since 21 Dec 2017 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class BasicCheckBoxList extends CheckBoxList { - private final Class clazz_; private final Set activeSet_; /** * Constructor. * - * @param clazz supertype for each entry in the list * @param canSelect true if list item selection is permitted */ - public BasicCheckBoxList( Class clazz, boolean canSelect ) { - super( clazz, new DefaultListModel(), canSelect, new JLabel() ); - clazz_ = clazz; + public BasicCheckBoxList( boolean canSelect ) { + super( new DefaultListModel(), canSelect, new JLabel() ); activeSet_ = new HashSet(); } + @Override + public DefaultListModel getModel() { + @SuppressWarnings("unchecked") + DefaultListModel model = (DefaultListModel) super.getModel(); + return model; + } + + @Override + public void setModel( ListModel model ) { + throw new UnsupportedOperationException(); + } + /** * Returns a list of all the items currently in this list. * @@ -43,18 +51,9 @@ */ public List getItems() { List list = new ArrayList(); - ListModel listModel = getModel(); + ListModel listModel = getModel(); for ( int i = 0; i < listModel.getSize(); i++ ) { - Object item = listModel.getElementAt( i ); - if ( item == null ) { - list.add( null ); - } - else { - T titem = getTypedValue( listModel.getElementAt( i ) ); - if ( titem != null ) { - list.add( titem ); - } - } + list.add( listModel.getElementAt( i ) ); } return list; } @@ -89,7 +88,7 @@ } public void moveItem( int ifrom, int ito ) { - DefaultListModel listModel = (DefaultListModel) getModel(); + DefaultListModel listModel = getModel(); listModel.add( ito, listModel.remove( ifrom ) ); } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/CheckBoxList.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/CheckBoxList.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/CheckBoxList.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/CheckBoxList.java 2020-06-04 17:10:04.000000000 +0000 @@ -46,10 +46,8 @@ * @author Mark Taylor * @since 13 Mar 2013 */ -@SuppressWarnings({"unchecked","rawtypes"}) -public abstract class CheckBoxList extends JList { +public abstract class CheckBoxList extends JList { - private final Class clazz_; private final boolean canSelect_; private final CheckBoxCellRenderer renderer_; private final DragListener dragger_; @@ -61,16 +59,14 @@ * A renderer component is supplied; when entries need to be displayed * the configureEntryRenderer method is called. * - * @param clazz supertype for each entry in the list * @param model list model * @param canSelect true if list item selection is permitted * @param entryRenderer renderer for list entry contents * (excluding drag and checkbox decorations) */ - public CheckBoxList( Class clazz, ListModel model, boolean canSelect, + public CheckBoxList( ListModel model, boolean canSelect, JComponent entryRenderer ) { super( model ); - clazz_ = clazz; canSelect_ = canSelect; /* Arrange to forward ListDataEvents from the base list model to @@ -158,22 +154,6 @@ public abstract void moveItem( int ifrom, int ito ); /** - * Returns a list cell entry cast to the entry type of this list, - * or null if it can't be done. - * - * @param value list entry - * @return typed list entry, or null - */ - public T getTypedValue( Object value ) { - return clazz_.isInstance( value ) ? clazz_.cast( value ) : null; - } - - @Override - public T getSelectedValue() { - return getTypedValue( super.getSelectedValue() ); - } - - /** * Programmatically sets the checkbox status for all the items in the list. * *

      The default implementation calls {@link #setChecked setChecked} @@ -183,10 +163,10 @@ * @param isChecked true to check all, false to uncheck all */ public void setCheckedAll( boolean isChecked ) { - ListModel model = getModel(); + ListModel model = getModel(); int nItem = model.getSize(); for ( int i = 0; i < nItem; i++ ) { - setChecked( (T) model.getElementAt( i ), isChecked ); + setChecked( model.getElementAt( i ), isChecked ); } } @@ -232,7 +212,6 @@ if ( dragItem != null ) { int fromIndex = dragger_.fromIndex_; CheckBoxCellRenderer dragComp = - (CheckBoxCellRenderer) renderer_.getListCellRendererComponent( this, dragItem, fromIndex, isSelectedIndex( fromIndex ), hasFocus() ); @@ -293,7 +272,7 @@ Point point = evt.getPoint(); if ( isCheckbox( point ) ) { int index = locationToIndex( point ); - T item = getTypedValue( getModel().getElementAt( index ) ); + T item = getModel().getElementAt( index ); if ( item != null ) { setChecked( item, ! isChecked( item ) ); ListDataEvent devt = @@ -392,7 +371,7 @@ @Override public void mouseDragged( MouseEvent evt ) { - dragItem_ = getTypedValue( getModel().getElementAt( fromIndex_ ) ); + dragItem_ = getModel().getElementAt( fromIndex_ ); dragPoint_ = evt.getPoint(); CheckBoxList.this.repaint(); } @@ -402,7 +381,7 @@ * Custom ListCellRenderer implementation for a CheckBoxList. */ private class CheckBoxCellRenderer extends JPanel - implements ListCellRenderer { + implements ListCellRenderer { private final JComponent entryRenderer_; private final JCheckBox checkBox_; @@ -428,15 +407,16 @@ add( entryRenderer_ ); } - public Component getListCellRendererComponent( JList list, Object value, - int index, boolean isSel, - boolean hasFocus ) { - dfltRenderer_.getListCellRendererComponent( list, value, index, + public CheckBoxCellRenderer + getListCellRendererComponent( JList list, + T item, int index, + boolean isSel, + boolean hasFocus ) { + dfltRenderer_.getListCellRendererComponent( list, item, index, isSel, hasFocus ); setBackground( dfltRenderer_.getBackground() ); setForeground( dfltRenderer_.getForeground() ); setBorder( dfltRenderer_.getBorder() ); - T item = getTypedValue( value ); final int itemWidth; if ( item != null ) { checkBox_.setSelected( isChecked( item ) ); diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/CheckBoxStack.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/CheckBoxStack.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/CheckBoxStack.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/CheckBoxStack.java 2020-06-04 17:10:04.000000000 +0000 @@ -37,14 +37,13 @@ * * @author Mark Taylor (Starlink) */ -@SuppressWarnings({"unchecked","rawtypes"}) -public class CheckBoxStack extends JPanel - implements ListSelectionListener, - ListDataListener, - Scrollable { +public class CheckBoxStack extends JPanel + implements ListSelectionListener, + ListDataListener, + Scrollable { private DefaultListSelectionModel selModel_; - private ListModel listModel_; + private ListModel listModel_; private List entries_; private final Annotator annotator_; @@ -55,7 +54,7 @@ * @param listModel the model * @param annotator object to generate annotations for each check box */ - public CheckBoxStack( ListModel listModel, Annotator annotator ) { + public CheckBoxStack( ListModel listModel, Annotator annotator ) { super( new GridBagLayout() ); annotator_ = annotator; setListModel( listModel ); @@ -67,7 +66,7 @@ * * @param listModel the model */ - public CheckBoxStack( ListModel listModel ) { + public CheckBoxStack( ListModel listModel ) { this( listModel, null ); } @@ -75,7 +74,7 @@ * Constructs a new CheckBoxStack from a default list model. */ public CheckBoxStack() { - this( new DefaultListModel() ); + this( new DefaultListModel() ); revalidate(); repaint(); } @@ -167,11 +166,11 @@ selModel_.addListSelectionListener( this ); } - public ListModel getListModel() { + public ListModel getListModel() { return listModel_; } - public void setListModel( ListModel listModel ) { + public void setListModel( ListModel listModel ) { if ( listModel_ != null ) { listModel_.removeListDataListener( this ); } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ClassComboBoxRenderer.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ClassComboBoxRenderer.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ClassComboBoxRenderer.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ClassComboBoxRenderer.java 2020-06-04 17:10:04.000000000 +0000 @@ -8,8 +8,7 @@ * @author Mark Taylor (Starlink) * @since 17 Aug 2004 */ -@SuppressWarnings("rawtypes") -public class ClassComboBoxRenderer extends CustomComboBoxRenderer { +public class ClassComboBoxRenderer extends CustomComboBoxRenderer> { /** * Constructs a renderer with a given null representation. @@ -17,11 +16,11 @@ * @param nullTxt representation of a null class */ public ClassComboBoxRenderer( String nullTxt ) { - super( Class.class, nullTxt ); + super( nullTxt ); } @Override - protected String mapValue( Class clazz ) { + protected String mapValue( Class clazz ) { String rep = clazz.getName(); return rep.substring( rep.lastIndexOf( '.' ) + 1 ); } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ClassifyWindow.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ClassifyWindow.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ClassifyWindow.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ClassifyWindow.java 2020-06-04 17:10:04.000000000 +0000 @@ -37,11 +37,10 @@ * @author Mark Taylor * @since 3 Feb 2015 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class ClassifyWindow extends AuxWindow { private final TopcatModel tcModel_; - private final JComboBox colSelector_; + private final JComboBox colSelector_; private final Action startAct_; private final Action stopAct_; private final Action subsetsAct_; @@ -64,7 +63,7 @@ tcModel_ = tcModel; /* UI components for acquiring user input. */ - colSelector_ = ColumnDataComboBoxModel.createComboBox(); + colSelector_ = new ColumnDataComboBox(); colSelector_.setModel( new ColumnDataComboBoxModel( tcModel, Object.class, true ) ); diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ColumnCellRenderer.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ColumnCellRenderer.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ColumnCellRenderer.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ColumnCellRenderer.java 2020-06-04 17:10:04.000000000 +0000 @@ -5,7 +5,9 @@ import javax.swing.JComponent; import javax.swing.JList; import javax.swing.ListCellRenderer; +import javax.swing.table.TableColumn; import javax.swing.plaf.basic.BasicComboBoxRenderer; +import uk.ac.starlink.table.ColumnInfo; import uk.ac.starlink.table.gui.StarTableColumn; /** @@ -14,12 +16,11 @@ * @author Mark Taylor (Starlink) * @since 20 Feb 2004 */ -@SuppressWarnings({"unchecked","rawtypes"}) -public class ColumnCellRenderer implements ListCellRenderer { +public class ColumnCellRenderer implements ListCellRenderer { - private final ListCellRenderer baseRenderer_; + private final BasicComboBoxRenderer baseRenderer_; private Object nullRep_; - private JComboBox comboBox_; + private JComboBox comboBox_; /** * Sets up a ColumnCellRenderer for a given combo box. @@ -28,7 +29,7 @@ * * @param comboBox box to watch */ - public ColumnCellRenderer( JComboBox comboBox ) { + public ColumnCellRenderer( JComboBox comboBox ) { comboBox_ = comboBox; /* Should I be getting this from the PLAF somehow? */ @@ -42,24 +43,29 @@ this( null ); } - public Component getListCellRendererComponent( JList list, Object value, - int index, - boolean isSelected, - boolean hasFocus ) { + public Component + getListCellRendererComponent( JList list, + TableColumn col, int index, + boolean isSelected, + boolean hasFocus ) { + ColumnInfo cinfo = col instanceof StarTableColumn + ? ((StarTableColumn) col).getColumnInfo() + : null; Object rep; - if ( value == null && nullRep_ != null ) { + if ( col == null && nullRep_ != null ) { rep = nullRep_; } else { - rep = mapValue( value ); + rep = cinfo == null + ? col + : cinfo.getName(); } Component comp = baseRenderer_ .getListCellRendererComponent( list, rep, index, isSelected, hasFocus ); - String descrip = value instanceof StarTableColumn - ? ((StarTableColumn) value).getColumnInfo() - .getDescription() - : null; + String descrip = cinfo == null + ? null + : cinfo.getDescription(); if ( comboBox_ != null ) { if ( descrip != null && descrip.trim().length() == 0 ) { descrip = null; @@ -70,19 +76,6 @@ } /** - * Provides the representation (to be displayed in the combo box) - * for an object in the box's model. - * - * @param value input value - * @return to which value is mapped - */ - public Object mapValue( Object value ) { - return value instanceof StarTableColumn - ? ((StarTableColumn) value).getColumnInfo().getName() - : value; - } - - /** * Sets the representation for the null item. * * @param nullRep null representation object to appear in combo box @@ -90,5 +83,4 @@ public void setNullRepresentation( Object nullRep ) { nullRep_ = nullRep; } - } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ColumnComboBoxModel.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ColumnComboBoxModel.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ColumnComboBoxModel.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ColumnComboBoxModel.java 2020-06-04 17:10:04.000000000 +0000 @@ -26,17 +26,16 @@ * * @author Mark Taylor (Starlink) */ -@SuppressWarnings({"unchecked","rawtypes"}) -public class ColumnComboBoxModel extends AbstractListModel +public class ColumnComboBoxModel extends AbstractListModel implements TableColumnModelListener, - ComboBoxModel { + ComboBoxModel { - private final TableColumnModel colModel; - private TableColumn selected; - private boolean hasNone; - private int dummyCount; + private final TableColumnModel colModel_; + private Object selected_; + private int dummyCount_; - private static ListCellRenderer colRenderer_ = new ColumnCellRenderer(); + private static ListCellRenderer colRenderer_ = + new ColumnCellRenderer(); public static final StarTableColumn NO_COLUMN = new StarTableColumn( new ColumnInfo( "" ), -1 ); @@ -51,7 +50,7 @@ * the list is required */ public ColumnComboBoxModel( TableColumnModel colModel, boolean hasNone ) { - this.colModel = colModel; + colModel_ = colModel; setHasNone( hasNone ); colModel.addColumnModelListener( new WeakTableColumnModelListener( this ) ); @@ -64,31 +63,25 @@ * the list is required */ public void setHasNone( boolean hasNone ) { - this.hasNone = hasNone; - this.dummyCount = hasNone ? 1 : 0; + dummyCount_ = hasNone ? 1 : 0; } public TableColumnModel getColumnModel() { - return colModel; + return colModel_; } - public Object getElementAt( int index ) { - index -= dummyCount; - return index >= 0 ? colModel.getColumn( index ) : NO_COLUMN; + public TableColumn getElementAt( int index ) { + index -= dummyCount_; + return index >= 0 ? colModel_.getColumn( index ) + : NO_COLUMN; } public int getSize() { - return colModel.getColumnCount() + dummyCount; + return colModel_.getColumnCount() + dummyCount_; } - /** - * The returned object is guaranteed to be a - * {@link javax.swing.table.TableColumn} or null. - * - * @return the selected TableColumn - */ public Object getSelectedItem() { - return selected; + return selected_; } /** @@ -96,12 +89,10 @@ * {@link javax.swing.table.TableColumn} object. * * @param item a table column to select - * @throws ClassCastException if item is not null or a - * TableColumn */ public void setSelectedItem( Object item ) { - if ( selected != item ) { - selected = (TableColumn) item; + if ( selected_ != item ) { + selected_ = item; /* This bit of magic is copied from the J2SE1.4 * DefaultComboBoxModel implementation - seems to be necessary @@ -119,35 +110,33 @@ * @return new combo box displaying this model * @see ColumnCellRenderer */ - public JComboBox makeComboBox() { - JComboBox box = new JComboBox( this ); + public JComboBox makeComboBox() { + JComboBox box = new JComboBox( this ); box.setRenderer( colRenderer_ ); return box; } - /* * Implementation of the TableColumnModelListener interface. */ public void columnAdded( TableColumnModelEvent evt ) { - int index = dummyCount + evt.getToIndex(); + int index = dummyCount_ + evt.getToIndex(); fireIntervalAdded( this, index, index ); } public void columnRemoved( TableColumnModelEvent evt ) { - int index = dummyCount + evt.getFromIndex(); + int index = dummyCount_ + evt.getFromIndex(); fireIntervalRemoved( this, index, index ); } public void columnMoved( TableColumnModelEvent evt ) { - int index0 = dummyCount + evt.getFromIndex(); - int index1 = dummyCount + evt.getToIndex(); + int index0 = dummyCount_ + evt.getFromIndex(); + int index1 = dummyCount_ + evt.getToIndex(); fireContentsChanged( this, index0, index1 ); } public void columnMarginChanged( ChangeEvent evt ) {} public void columnSelectionChanged( ListSelectionEvent evt ) {} - } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ColumnDataComboBox.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ColumnDataComboBox.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ColumnDataComboBox.java 1970-01-01 00:00:00.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ColumnDataComboBox.java 2020-06-04 17:10:04.000000000 +0000 @@ -0,0 +1,229 @@ +package uk.ac.starlink.topcat; + +import gnu.jel.CompilationException; +import java.awt.Color; +import java.awt.Component; +import java.awt.event.ActionListener; +import java.io.IOException; +import javax.swing.ComboBoxEditor; +import javax.swing.ComboBoxModel; +import javax.swing.JComboBox; +import javax.swing.JOptionPane; +import javax.swing.UIManager; +import javax.swing.plaf.basic.BasicComboBoxEditor; +import uk.ac.starlink.table.ColumnData; +import uk.ac.starlink.table.ColumnInfo; +import uk.ac.starlink.table.Domain; +import uk.ac.starlink.table.DomainMapper; + +/** + * JComboBox suitable for use with a ColumnComboBoxModel. + * It installs (and deinstalls as appropriate) + * {@link javax.swing.ComboBoxEditor}s which allow for + * textual expressions to be interpreted as JEL expressions based + * on the TopcatModel on which this model is based. + * This facility is only available/useful in the case that the + * combo box is editable; so the returned combo box is editable. + * Currently no default renderer is required or installed. + * + * @author Mark Taylor + * @since 7 Apr 2020 + */ +public class ColumnDataComboBox extends JComboBox { + + private final Domain domain_; + private final DomainMapperComboBox mapperSelector_; + + /** + * Constructs a domain-less selector. + */ + public ColumnDataComboBox() { + this( null ); + } + + /** + * Constructs a selector with a given target value domain. + * + * @param domain required value domain + */ + public ColumnDataComboBox( Domain domain ) { + domain_ = domain; + mapperSelector_ = domain == null + ? null + : new DomainMapperComboBox( domain, this ); + setEditable( true ); + } + + /** + * Returns a component that should be presented to the user for + * selecting domain mapper alongside the input value selector. + * This method returns non-null only if there is a material + * choice to be made; if there's only one option, null is returned. + * + * @return domain mapper selector component, or null + */ + public DomainMapperComboBox getDomainMapperSelector() { + return mapperSelector_ != null && mapperSelector_.getItemCount() > 1 + ? mapperSelector_ + : null; + } + + @Override + public void setModel( ComboBoxModel model ) { + super.setModel( model ); + if ( model instanceof ColumnDataComboBoxModel ) { + ColumnDataComboBoxModel emodel = + (ColumnDataComboBoxModel) model; + setEditor( new ColumnDataEditor( emodel, this ) ); + } + } + + /** + * Returns the currently selected DomainMapper. + * This may have been actively selected by the user, or may be the + * only option. If no guess can be made about what mapper to use, + * including if no domain has been specified, the return value may be null. + * + * @return selected domain mapper + */ + public DomainMapper getDomainMapper() { + if ( mapperSelector_ != null ) { + return mapperSelector_ + .getItemAt( mapperSelector_.getSelectedIndex() ); + } + else { + return null; + } + } + + @Override + public void addActionListener( ActionListener listener ) { + super.addActionListener( listener ); + if ( mapperSelector_ != null ) { + mapperSelector_.addActionListener( listener ); + } + } + + @Override + public void removeActionListener( ActionListener listener ) { + super.removeActionListener( listener ); + if ( mapperSelector_ != null ) { + mapperSelector_.removeActionListener( listener ); + } + } + + /** + * ComboBoxEditor implementation suitable for use with a + * ColumnDataComboBoxModel. + */ + private static class ColumnDataEditor extends BasicComboBoxEditor { + + private final ColumnDataComboBoxModel model_; + private final Component parent_; + private final ComboBoxEditor base_; + private final Color okColor_; + private final Color errColor_; + private String text_; + private ColumnData data_; + + /** + * Constructor. + * + * @param model model which this editor can work with + * @param parent parent component + */ + public ColumnDataEditor( ColumnDataComboBoxModel model, + Component parent ) { + model_ = model; + parent_ = parent; + base_ = new JComboBox().getEditor(); + okColor_ = UIManager.getColor( "ComboBox.foreground" ); + errColor_ = UIManager.getColor( "ComboBox.disabledForeground" ); + } + + public void setItem( Object obj ) { + base_.setItem( toStringOrData( obj ) ); + } + + public Object getItem() { + return toStringOrData( base_.getItem() ); + } + + /** + * Configures the editor component to give a visual indication + * of whether a legal column data object is currently visible. + * + * @param isOK true for usable data, false for not + */ + private void setOk( boolean isOk ) { + base_.getEditorComponent() + .setForeground( isOk ? okColor_ : errColor_ ); + } + + /** + * Takes an object which is a possible content of this editor and + * returns a corresponding ColumnData object if possible, + * otherwise a string. + * This method informs the user via a popup if a string cannot + * be converted to data. It caches values so that it does not + * keep showing the same popup for the same string. + * + * @param item input object + * @return output object, should be of type String or + * (preferably) ColumnData + */ + private Object toStringOrData( Object item ) { + if ( item instanceof ColumnData ) { + text_ = null; + data_ = (ColumnData) item; + } + else if ( item instanceof String ) { + String txt = (String) item; + if ( ! txt.equals( text_ ) ) { + ColumnData colData; + CompilationException err; + try { + colData = model_.stringToColumnData( txt ); + err = null; + } + catch ( CompilationException e ) { + colData = null; + err = e; + } + text_ = txt; + data_ = colData; + if ( err != null ) { + setOk( false ); + JOptionPane + .showMessageDialog( parent_, err.getMessage(), + "Evaluation Error", + JOptionPane.ERROR_MESSAGE ); + } + } + } + else if ( item == null ) { + data_ = null; + text_ = null; + } + setOk( data_ != null || text_ == null + || text_.trim().length() == 0 ); + return data_ != null ? data_ : text_; + } + + public Component getEditorComponent() { + return base_.getEditorComponent(); + } + + public void selectAll() { + base_.selectAll(); + } + + public void removeActionListener( ActionListener listener ) { + base_.removeActionListener( listener ); + } + + public void addActionListener( ActionListener listener ) { + base_.addActionListener( listener ); + } + } +} diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ColumnDataComboBoxModel.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ColumnDataComboBoxModel.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ColumnDataComboBoxModel.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ColumnDataComboBoxModel.java 2020-06-04 17:10:04.000000000 +0000 @@ -1,25 +1,15 @@ package uk.ac.starlink.topcat; import gnu.jel.CompilationException; -import java.awt.Color; -import java.awt.Component; -import java.awt.Toolkit; -import java.awt.event.ActionListener; import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.logging.Logger; import javax.swing.AbstractListModel; -import javax.swing.ComboBoxEditor; import javax.swing.ComboBoxModel; -import javax.swing.JComboBox; -import javax.swing.JOptionPane; -import javax.swing.UIManager; import javax.swing.event.ChangeEvent; import javax.swing.event.ListSelectionEvent; import javax.swing.event.TableColumnModelEvent; import javax.swing.event.TableColumnModelListener; -import javax.swing.plaf.basic.BasicComboBoxEditor; import javax.swing.table.TableColumnModel; import uk.ac.starlink.table.ColumnData; import uk.ac.starlink.table.ColumnInfo; @@ -42,16 +32,15 @@ * and this should be ignored (treated as null) for the purposes * of data access. * - *

      The {@link #createComboBox} method provides a JComboBox which is a + *

      The {@link ColumnDataComboBox} class should generally be used as a * suitable host for instances of this class. * * @author Mark Taylor * @since 23 Jan 2005 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class ColumnDataComboBoxModel - extends AbstractListModel - implements TableColumnModelListener, ComboBoxModel { + extends AbstractListModel + implements TableColumnModelListener, ComboBoxModel { private final TopcatModel tcModel_; private final Filter filter_; @@ -62,8 +51,6 @@ private List modelColumns_; private Object selected_; - private static final Logger logger = - Logger.getLogger( "uk.ac.starlink.topcat" ); private static final ValueInfo INDEX_INFO = new DefaultValueInfo( "index", Long.class, "Row index" ); @@ -146,7 +133,7 @@ this( tcModel, dataClazz, hasNone, false ); } - public Object getElementAt( int index ) { + public ColumnData getElementAt( int index ) { return activeColumns_.get( index ); } @@ -439,34 +426,6 @@ public void columnSelectionChanged( ListSelectionEvent evt ) {} /** - * Constructs and returns a JComboBox suitable for use with - * a ColumnDataComboBoxModel. It installs - * (and deinstalls as appropriate) - * {@link javax.swing.ComboBoxEditor}s which allow for - * textual expressions to be interpreted as JEL expressions based - * on the TopcatModel on which this model is based. - * This facility is only available/useful in the case that the - * combo box is editable; so the returned combo box is editable. - * Currently no default renderer is required or installed. - * - * @return new custom combo box - */ - public static JComboBox createComboBox() { - JComboBox comboBox = new JComboBox() { - public void setModel( ComboBoxModel model ) { - super.setModel( model ); - if ( model instanceof ColumnDataComboBoxModel ) { - ColumnDataComboBoxModel emodel = - (ColumnDataComboBoxModel) model; - setEditor( new ColumnDataEditor( emodel, this ) ); - } - } - }; - comboBox.setEditable( true ); - return comboBox; - } - - /** * Creates a ColumnData object simply representing a single column * of a table. * Behaviour is undefined if tcol is not associated with the model. @@ -523,120 +482,6 @@ } /** - * ComboBoxEditor implementation suitable for use with a - * ColumnDataComboBoxModel. - */ - private static class ColumnDataEditor extends BasicComboBoxEditor { - - private final ColumnDataComboBoxModel model_; - private final Component parent_; - private final ComboBoxEditor base_; - private final Color okColor_; - private final Color errColor_; - private String text_; - private ColumnData data_; - - /** - * Constructor. - * - * @param model model which this editor can work with - */ - public ColumnDataEditor( ColumnDataComboBoxModel model, - Component parent ) { - model_ = model; - parent_ = parent; - base_ = new JComboBox().getEditor(); - okColor_ = UIManager.getColor( "ComboBox.foreground" ); - errColor_ = UIManager.getColor( "ComboBox.disabledForeground" ); - } - - public void setItem( Object obj ) { - base_.setItem( toStringOrData( obj ) ); - } - - public Object getItem() { - return toStringOrData( base_.getItem() ); - } - - /** - * Configures the editor component to give a visual indication - * of whether a legal column data object is currently visible. - * - * @param isOK true for usable data, false for not - */ - private void setOk( boolean isOk ) { - base_.getEditorComponent() - .setForeground( isOk ? okColor_ : errColor_ ); - } - - /** - * Takes an object which is a possible content of this editor and - * returns a corresponding ColumnData object if possible, - * otherwise a string. - * This method informs the user via a popup if a string cannot - * be converted to data. It caches values so that it does not - * keep showing the same popup for the same string. - * - * @param item input object - * @return output object, should be of type String or - * (preferably) ColumnData - */ - private Object toStringOrData( Object item ) { - if ( item instanceof ColumnData ) { - text_ = null; - data_ = (ColumnData) item; - } - else if ( item instanceof String ) { - String txt = (String) item; - if ( ! txt.equals( text_ ) ) { - ColumnData colData; - CompilationException err; - try { - colData = model_.stringToColumnData( txt ); - err = null; - } - catch ( CompilationException e ) { - colData = null; - err = e; - } - text_ = txt; - data_ = colData; - if ( err != null ) { - setOk( false ); - JOptionPane - .showMessageDialog( parent_, err.getMessage(), - "Evaluation Error", - JOptionPane.ERROR_MESSAGE ); - } - } - } - else if ( item == null ) { - data_ = null; - text_ = null; - } - setOk( data_ != null || text_ == null - || text_.trim().length() == 0 ); - return data_ != null ? data_ : text_; - } - - public Component getEditorComponent() { - return base_.getEditorComponent(); - } - - public void selectAll() { - base_.selectAll(); - } - - public void removeActionListener( ActionListener listener ) { - base_.removeActionListener( listener ); - } - - public void addActionListener( ActionListener listener ) { - base_.addActionListener( listener ); - } - } - - /** * ColumnData implementation for a column defined by a JEL expression. * This just extends SyntheticColumn so that it can provide sensible * equals() and toString() methods. diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ColumnInfoWindow.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ColumnInfoWindow.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ColumnInfoWindow.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ColumnInfoWindow.java 2020-06-04 17:10:04.000000000 +0000 @@ -259,7 +259,7 @@ DomainMapper mapper = mappers[ i ]; sbuf.append( mapper.getSourceName() ) .append( "->" ) - .append( mapper.getTargetName() ); + .append( mapper.getTargetDomain().getDomainName() ); } return sbuf.toString(); } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ColumnSearchWindow.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ColumnSearchWindow.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ColumnSearchWindow.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ColumnSearchWindow.java 2020-06-04 17:10:04.000000000 +0000 @@ -45,12 +45,11 @@ * @author Mark Taylor * @since 28 Jun 2018 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class ColumnSearchWindow extends AuxDialog { private final TableViewerWindow viewWindow_; private final TopcatModel tcModel_; - private final JComboBox colSelector_; + private final JComboBox colSelector_; private final ValueButtonGroup syntaxGroup_; private final ValueButtonGroup scopeGroup_; private final JCheckBox caseToggle_; @@ -83,7 +82,7 @@ return canSearchColumn( info ); } }; - colSelector_ = new JComboBox( colselModel ); + colSelector_ = new JComboBox( colselModel ); colSelector_.setRenderer( new ColumnCellRenderer( colSelector_ ) ); colSelector_.addActionListener( forwarder ); JComponent colselLine = Box.createHorizontalBox(); diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ColumnSelector.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ColumnSelector.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ColumnSelector.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ColumnSelector.java 2020-06-04 17:10:04.000000000 +0000 @@ -24,13 +24,12 @@ * @since 6 Oct 2004 * @see ColumnSelectorModel */ -@SuppressWarnings({"unchecked","rawtypes"}) public class ColumnSelector extends JComponent { private ColumnSelectorModel model_; private final ValueInfo info_; - private final JComboBox colComboBox_; - private final JComboBox convComboBox_; + private final JComboBox colComboBox_; + private final JComboBox convComboBox_; private final Component[] components_; private final JLabel label_; @@ -52,12 +51,12 @@ label_.setToolTipText( "Select column for " + info_.getDescription() ); /* Set up column selector box. */ - colComboBox_ = ColumnDataComboBoxModel.createComboBox(); + colComboBox_ = new ColumnDataComboBox(); /* Set up converter selector box if necessary. */ ColumnConverter[] converters = ColumnConverter.getConverters( info_ ); if ( converters.length > 1 ) { - convComboBox_ = new JComboBox( converters ); + convComboBox_ = new JComboBox( converters ); convComboBox_.setSelectedIndex( 0 ); convComboBox_.setToolTipText( "Units for column " + info_.getName() ); @@ -119,10 +118,10 @@ model_ = model; if ( model == null ) { setEnabled( false ); - ComboBoxModel dummy = new DefaultComboBoxModel(); - colComboBox_.setModel( dummy ); + colComboBox_.setModel( new DefaultComboBoxModel() ); if ( convComboBox_ != null ) { - convComboBox_.setModel( dummy ); + convComboBox_ + .setModel( new DefaultComboBoxModel() ); } } else { @@ -215,7 +214,7 @@ * * @return column selection component */ - public JComboBox getColumnComponent() { + public JComboBox getColumnComponent() { return colComboBox_; } @@ -224,7 +223,7 @@ * * @return converter selection component */ - public JComboBox getUnitComponent() { + public JComboBox getUnitComponent() { return convComboBox_; } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ColumnSelectorModel.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ColumnSelectorModel.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ColumnSelectorModel.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ColumnSelectorModel.java 2020-06-04 17:10:04.000000000 +0000 @@ -24,17 +24,16 @@ * @author Mark Taylor (Starlink) * @since 6 Oct 2004 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class ColumnSelectorModel { private final ValueInfo info_; - private final ComboBoxModel convChooser_; + private final ComboBoxModel convChooser_; private final ColumnConverter converter0_; private final Map convMap_ = new HashMap(); private final SelectionListener selectionListener_; private TopcatModel tcModel_; - private ComboBoxModel colChooser_; + private ComboBoxModel colChooser_; /** * Constructs a new model for a given table and value type. @@ -52,7 +51,8 @@ ColumnConverter[] converters = ColumnConverter.getConverters( info ); if ( converters.length > 1 ) { converter0_ = null; - convChooser_ = new DefaultComboBoxModel( converters ); + convChooser_ = + new DefaultComboBoxModel( converters ); convChooser_.addListDataListener( selectionListener_ ); } else { @@ -121,7 +121,7 @@ * * @return columns combo box model */ - public ComboBoxModel getColumnModel() { + public ComboBoxModel getColumnModel() { return colChooser_; } @@ -131,7 +131,7 @@ * * @return converter combo box model, or null */ - public ComboBoxModel getConverterModel() { + public ComboBoxModel getConverterModel() { return convChooser_; } @@ -177,11 +177,11 @@ } colChooser_.setSelectedItem( cdata ); if ( convTxt != null ) { - Object convItem = null; + ColumnConverter convItem = null; for ( int i = 0; i < convChooser_.getSize(); i++ ) { - Object item = convChooser_.getElementAt( i ); - if ( item.toString().equals( convTxt ) ) { - convItem = item; + ColumnConverter conv = convChooser_.getElementAt( i ); + if ( conv.toString().equals( convTxt ) ) { + convItem = conv; } } if ( convItem != null ) { @@ -267,8 +267,7 @@ if ( units.equals( "radian" ) || units.equals( "radians" ) ) { if ( cunits.startsWith( "rad" ) ) { for ( int i = 0; i < nconv; i++ ) { - ColumnConverter conv = - (ColumnConverter) convChooser_.getElementAt( i ); + ColumnConverter conv = convChooser_.getElementAt( i ); if ( conv.toString().toLowerCase() .startsWith( "rad" ) ) { return conv; @@ -277,8 +276,7 @@ } else if ( cunits.startsWith( "deg" ) ) { for ( int i = 0; i < nconv; i++ ) { - ColumnConverter conv = - (ColumnConverter) convChooser_.getElementAt( i ); + ColumnConverter conv = convChooser_.getElementAt( i ); if ( conv.toString().toLowerCase() .startsWith( "deg" ) ) { return conv; @@ -288,8 +286,7 @@ else if ( cunits.startsWith( "hour" ) || cunits.equals( "hr" ) || cunits.equals( "hrs" ) ) { for ( int i = 0; i < nconv; i++ ) { - ColumnConverter conv = - (ColumnConverter) convChooser_.getElementAt( i ); + ColumnConverter conv = convChooser_.getElementAt( i ); if ( conv.toString().toLowerCase() .startsWith( "hour" ) ) { return conv; @@ -298,8 +295,7 @@ } else if ( cunits.startsWith( "arcmin" ) ) { for ( int i = 0; i < nconv; i++ ) { - ColumnConverter conv = - (ColumnConverter) convChooser_.getElementAt( i ); + ColumnConverter conv = convChooser_.getElementAt( i ); if ( conv.toString().toLowerCase() .startsWith( "arcmin" ) ) { return conv; @@ -308,8 +304,7 @@ } else if ( cunits.startsWith( "arcsec" ) ) { for ( int i = 0; i < nconv; i++ ) { - ColumnConverter conv = - (ColumnConverter) convChooser_.getElementAt( i ); + ColumnConverter conv = convChooser_.getElementAt( i ); if ( conv.toString().toLowerCase() .startsWith( "arcsec" ) ) { return conv; @@ -329,16 +324,16 @@ * The elements of the model are instances of * ColumnData (or null). */ - private static ComboBoxModel makeColumnModel( TopcatModel tcModel, - ValueInfo argInfo ) { + private static ComboBoxModel + makeColumnModel( TopcatModel tcModel, ValueInfo argInfo ) { /* With no table, the model is empty. */ if ( tcModel == null ) { - return new DefaultComboBoxModel( new Object[ 1 ] ); + return new DefaultComboBoxModel( new ColumnData[ 1 ] ); } /* Make the model. */ - ComboBoxModel model = + ComboBoxModel model = new ColumnDataComboBoxModel( tcModel, argInfo.getContentClass(), argInfo.isNullable() ); diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ConcatWindow.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ConcatWindow.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ConcatWindow.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ConcatWindow.java 2020-06-04 17:10:04.000000000 +0000 @@ -43,11 +43,10 @@ * @author Mark Taylor (Starlink) * @since 25 Mar 2004 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class ConcatWindow extends AuxWindow { - private final JComboBox t1selector; - private final JComboBox t2selector; + private final JComboBox t1selector; + private final JComboBox t2selector; private final JScrollPane colScroller; private final Action goAct; private ColumnDataComboBoxModel[] colSelectorModels_; @@ -200,7 +199,7 @@ new ColumnDataComboBoxModel( tc2, clazz, true ); comboModel.setSelectedItem( comboModel.getElementAt( 0 ) ); colSelectorModels_[ icol ] = comboModel; - JComboBox comboBox = ColumnDataComboBoxModel.createComboBox(); + JComboBox comboBox = new ColumnDataComboBox(); comboBox.setModel( comboModel ); colPanel.add( comboBox ); } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/contrib/basti/BaSTIPanel.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/contrib/basti/BaSTIPanel.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/contrib/basti/BaSTIPanel.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/contrib/basti/BaSTIPanel.java 2020-06-04 17:10:04.000000000 +0000 @@ -33,7 +33,6 @@ * * @author molinaro */ -@SuppressWarnings({"unchecked","rawtypes"}) public class BaSTIPanel { //static String[] OutPutTables = null; @@ -59,7 +58,7 @@ /* Data Type Selection */ static JLabel DataTypeLabel = new JLabel("Data Type"); static JCheckBox DataTypeCheck = new JCheckBox(); - static JComboBox DataType = new JComboBox(); + static JComboBox DataType = new JComboBox(); static String[] DataTypeChoice = {"", "Isochrone", "Track", @@ -100,28 +99,28 @@ /* SCENARIO */ static JLabel ScenarioLabel = new JLabel("Scenario"); static JCheckBox ScenarioCheck = new JCheckBox(); - static JComboBox Scenario = new JComboBox(); + static JComboBox Scenario = new JComboBox(); static String[] ScenarioChoice = {"", "Canonical", "Overshooting"}; /* TYPE */ static JLabel TypeLabel = new JLabel("Type"); static JCheckBox TypeCheck = new JCheckBox(); - static JComboBox Type = new JComboBox(); + static JComboBox Type = new JComboBox(); static String[] TypeChoice = {"", "Normal", "AGB Extended"}; /* Mass Loss */ static JLabel MassLossLabel = new JLabel("Mass Loss"); static JCheckBox MassLossCheck = new JCheckBox(); - static JComboBox MassLoss = new JComboBox(); + static JComboBox MassLoss = new JComboBox(); static String[] MassLossChoice = {"", "0.2", "0.4"}; /* Photometric System */ static JLabel PhotometryLabel = new JLabel("Photometric System"); static JCheckBox PhotometryCheck = new JCheckBox(); - static JComboBox Photometry = new JComboBox(); + static JComboBox Photometry = new JComboBox(); static String[] PhotometryChoice = {"", "ACS", "Johnson Castelli", @@ -133,7 +132,7 @@ /* Mixture */ static JLabel MixtureLabel = new JLabel("Mixture"); static JCheckBox MixtureCheck = new JCheckBox(); - static JComboBox Mixture = new JComboBox(); + static JComboBox Mixture = new JComboBox(); static String[] MixtureChoice = {"", "Scaled Solar Model", "Alpha Enhanced"}; @@ -176,12 +175,13 @@ * every token has its own label and its checkbox */ /* setting dropdowns' content */ - DataType.setModel( new DefaultComboBoxModel( DataTypeChoice ) ); - Scenario.setModel( new DefaultComboBoxModel( ScenarioChoice ) ); - Type.setModel( new DefaultComboBoxModel( TypeChoice ) ); - MassLoss.setModel( new DefaultComboBoxModel( MassLossChoice ) ); - Photometry.setModel( new DefaultComboBoxModel( PhotometryChoice ) ); - Mixture.setModel( new DefaultComboBoxModel( MixtureChoice ) ); + DataType.setModel( new DefaultComboBoxModel( DataTypeChoice ) ); + Scenario.setModel( new DefaultComboBoxModel( ScenarioChoice ) ); + Type.setModel( new DefaultComboBoxModel( TypeChoice ) ); + MassLoss.setModel( new DefaultComboBoxModel( MassLossChoice ) ); + Photometry.setModel( new DefaultComboBoxModel + ( PhotometryChoice ) ); + Mixture.setModel( new DefaultComboBoxModel( MixtureChoice ) ); /* setting (default) starting values for the query */ BaSTIPanelActions.ResetQuery(); /* Results Tab Components */ diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/contrib/gavo/GavoTableLoadDialog.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/contrib/gavo/GavoTableLoadDialog.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/contrib/gavo/GavoTableLoadDialog.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/contrib/gavo/GavoTableLoadDialog.java 2020-06-04 17:10:04.000000000 +0000 @@ -50,7 +50,6 @@ import uk.ac.starlink.topcat.ResourceIcon; import uk.ac.starlink.util.Base64OutputStream; -@SuppressWarnings({"unchecked","rawtypes"}) public class GavoTableLoadDialog extends AbstractTableLoadDialog { private int nquery = 0; @@ -81,7 +80,7 @@ private static final Logger logger_ = Logger.getLogger( "uk.ac.starlink.topcat.contrib" ); - private JComboBox urlField_; + private JComboBox urlField_; private JTextField userField_; private JPasswordField passField_; private JTextArea sqlField_; @@ -100,7 +99,7 @@ protected Component createQueryComponent() { /* Set up fields for user interaction. */ - urlField_ = new JComboBox(DATABASES); + urlField_ = new JComboBox(DATABASES); urlField_.setEditable(true); userField_ = new JTextField(); passField_ = new JPasswordField(); diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ControlWindow.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ControlWindow.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ControlWindow.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ControlWindow.java 2020-06-04 17:10:04.000000000 +0000 @@ -149,7 +149,6 @@ * @author Mark Taylor (Starlink) * @since 9 Mar 2004 */ -@SuppressWarnings({"unchecked","rawtypes","deprecation"}) public class ControlWindow extends AuxWindow implements ListSelectionListener, ListDataListener, @@ -170,9 +169,9 @@ */ public static String TOPCAT_TOOLS_PROP = "topcat.exttools"; - private final JList tablesList_; - private final TablesListModel tablesModel_; - private final DefaultListModel loadingModel_; + private final JList tablesList_; + private final DefaultListModel tablesModel_; + private final DefaultListModel loadingModel_; private final TableModelListener tableWatcher_ = this; private final TopcatListener topcatWatcher_ = this; private final ListSelectionListener selectionWatcher_ = this; @@ -189,8 +188,6 @@ private final TransferHandler bothTransferHandler_ = new ControlTransferHandler( true, true ); private final Window window_ = this; - private final ComboBoxModel dummyComboBoxModel_ = - new DefaultComboBoxModel(); private final ButtonModel dummyButtonModel_ = new DefaultButtonModel(); private StarTableFactory tabfact_ = new StarTableFactory( true ); private final boolean showListToolBar_ = false; @@ -212,8 +209,8 @@ private final JLabel rowsLabel_ = new JLabel(); private final JLabel qstatusLabel_ = new JLabel(); private final JLabel colsLabel_ = new JLabel(); - private final JComboBox subsetSelector_ = new JComboBox(); - private final JComboBox sortSelector_ = new JComboBox(); + private final JComboBox subsetSelector_ = new JComboBox<>(); + private final JComboBox sortSelector_ = new JComboBox<>(); private final JToggleButton sortSenseButton_ = new UpDownButton(); private final JLabel activatorLabel_ = new JLabel(); private final TopcatCommunicator communicator_; @@ -251,9 +248,9 @@ taboutput_.setJDBCHandler( tabfact_.getJDBCHandler() ); /* Set up a list of the known tables. */ - tablesModel_ = new TablesListModel(); - loadingModel_ = new DefaultListModel(); - tablesList_ = new JList( tablesModel_ ); + tablesModel_ = new DefaultListModel(); + loadingModel_ = new DefaultListModel(); + tablesList_ = new JList( tablesModel_ ); /* Watch the list. */ tablesList_.addListSelectionListener( selectionWatcher_ ); @@ -294,7 +291,7 @@ /* Set up a split pane in the main panel. */ JSplitPane splitter = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT ); - JList loadingList = new LoadingList( loadingModel_ ); + JList loadingList = new LoadingList( loadingModel_ ); JScrollPane listScroller = new JScrollPane( new JList2( tablesList_, loadingList ) ); JPanel listPanel = new JPanel( new BorderLayout() ); @@ -443,9 +440,9 @@ new Plot2WindowAction( PlotWindowType.SKY ), new Plot2WindowAction( PlotWindowType.CUBE ), new Plot2WindowAction( PlotWindowType.SPHERE ), + new Plot2WindowAction( PlotWindowType.TIME ), }; Action[] morePlot2Acts = new Action[] { - new Plot2WindowAction( PlotWindowType.TIME ), }; matchActs_ = new Action[] { @@ -582,9 +579,6 @@ toolBar.addSeparator(); /* Add miscellaneous actions to the toolbar. */ - if ( interopAct != null ) { - toolBar.add( interopAct ); - } toolBar.add( MethodWindow.getWindowAction( this, false ) ); for ( TopcatToolAction tact : Loader.getClassInstances( TOPCAT_TOOLS_PROP, @@ -970,12 +964,8 @@ * @return array of selected tables */ private TopcatModel[] getSelectedModels() { - Object[] selObjs = tablesList_.getSelectedValues(); - TopcatModel[] selModels = new TopcatModel[ selObjs.length ]; - for ( int i = 0; i < selObjs.length; i++ ) { - selModels[ i ] = (TopcatModel) selObjs[ i ]; - } - return selModels; + return tablesList_.getSelectedValuesList() + .toArray( new TopcatModel[ 0 ] ); } /** @@ -984,7 +974,7 @@ * * @return list model of {@link TopcatModel} objects */ - public TypedListModel getTablesListModel() { + public ListModel getTablesListModel() { return tablesModel_; } @@ -993,7 +983,7 @@ * * @return list of {@link TopcatModel} objects */ - public JList getTablesList() { + public JList getTablesList() { return tablesList_; } @@ -1304,8 +1294,8 @@ rowsLabel_.setText( null ); colsLabel_.setText( null ); - sortSelector_.setModel( dummyComboBoxModel_ ); - subsetSelector_.setModel( dummyComboBoxModel_ ); + sortSelector_.setModel( new DefaultComboBoxModel() ); + subsetSelector_.setModel( new DefaultComboBoxModel() ); sortSenseButton_.setModel( dummyButtonModel_ ); activatorLabel_.setText( null ); } @@ -1370,7 +1360,7 @@ */ public void valueChanged( ListSelectionEvent evt ) { - TopcatModel nextModel = (TopcatModel) tablesList_.getSelectedValue(); + TopcatModel nextModel = tablesList_.getSelectedValue(); if ( nextModel != currentModel_ ) { if ( currentModel_ != null ) { currentModel_.removeTopcatListener( topcatWatcher_ ); @@ -2279,16 +2269,4 @@ add( filler ); } } - - /** - * ListModel for holding TopcatModels. - */ - private static class TablesListModel - extends DefaultListModel - implements TypedListModel { - @Override - public TopcatModel getElementAt( int index ) { - return (TopcatModel) super.getElementAt( index ); - } - } } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/CurrentSavePanel.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/CurrentSavePanel.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/CurrentSavePanel.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/CurrentSavePanel.java 2020-06-04 17:10:04.000000000 +0000 @@ -20,7 +20,6 @@ * * @author Mark Taylor */ -@SuppressWarnings("rawtypes") public class CurrentSavePanel extends SavePanel { private final JLabel nameField_; @@ -42,14 +41,13 @@ super( "Current Table", TableSaveChooser.makeFormatBoxModel( sto, false ) ); setBorder( BorderFactory.createEmptyBorder( 5, 5, 5, 5 ) ); - final JList tablesList = + final JList tablesList = ControlWindow.getInstance().getTablesList(); /* Ensure displayed table is always the TOPCAT current table. */ tablesList.addListSelectionListener( new ListSelectionListener() { public void valueChanged( ListSelectionEvent evt ) { - setDisplayedTable( (TopcatModel) - tablesList.getSelectedValue() ); + setDisplayedTable( tablesList.getSelectedValue() ); } } ); @@ -111,7 +109,7 @@ stack.addLine( "Columns", colsField_ ); stack.addLine( "Rows", rowsField_ ); } - setDisplayedTable( (TopcatModel) tablesList.getSelectedValue() ); + setDisplayedTable( tablesList.getSelectedValue() ); } public StarTable[] getTables() { diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/DomainMapperComboBox.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/DomainMapperComboBox.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/DomainMapperComboBox.java 1970-01-01 00:00:00.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/DomainMapperComboBox.java 2020-06-04 17:10:04.000000000 +0000 @@ -0,0 +1,172 @@ +package uk.ac.starlink.topcat; + +import java.awt.Component; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.swing.Box; +import javax.swing.DefaultListCellRenderer; +import javax.swing.JComboBox; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JToggleButton; +import uk.ac.starlink.table.ColumnData; +import uk.ac.starlink.table.ColumnInfo; +import uk.ac.starlink.table.Domain; +import uk.ac.starlink.table.DomainMapper; +import uk.ac.starlink.topcat.ToggleButtonModel; +import uk.ac.starlink.util.gui.ComboBoxBumper; +import uk.ac.starlink.util.gui.ShrinkWrapper; + +/** + * ComboBox for selecting DomainMappers appropriate for a given Domain. + * It works alongside a ColumnData selector, since the default and available + * DomainMappers will be a function of the currently selected ColumnData + * as well as of the Domain. + * + * @author Mark Taylor + * @since 15 Apr 2020 + */ +public class DomainMapperComboBox extends JComboBox { + + private final Domain domain_; + private final JComboBox columnSelector_; + private final JComponent line_; + private final List mappers_; + private Object coldata_; + + /** + * Constructor. + * + * @param domain domain for which mappers can be selected + * @param columnSelector column selector with which this selector + * is associated + */ + public DomainMapperComboBox( Domain domain, + JComboBox columnSelector ) { + domain_ = domain; + columnSelector_ = columnSelector; + final JToggleButton lockButton = new JToggleButton( ResourceIcon.LOCK ); + lockButton.setToolTipText( "Lock " + domain.getDomainName() + + " type selector" ); + lockButton.setMargin( new Insets( 0, 0, 0, 0 ) ); + lockButton.setSelected( false ); + lockButton.addActionListener( new ActionListener() { + public void actionPerformed( ActionEvent evt ) { + if ( ! lockButton.isSelected() ) { + updateMapper(); + } + } + } ); + mappers_ = new ArrayList(); + if ( domain.getMappers().length > 1 ) { + mappers_.add( null ); + } + mappers_.addAll( Arrays.asList( domain.getMappers() ) ); + for ( DomainMapper mapper : mappers_ ) { + addItem( mapper ); + } + setRenderer( new DefaultListCellRenderer() { + @Override + public Component getListCellRendererComponent( JList list, + Object value, + int index, + boolean isSel, + boolean hasFocus ) { + Component c = + super.getListCellRendererComponent( list, value, index, + isSel, hasFocus ); + if ( c instanceof JLabel ) { + ((JLabel) c).setText( value instanceof DomainMapper + ? ((DomainMapper) value).getSourceName() + : " " ); + } + return c; + } + } ); + columnSelector_.addItemListener( new ItemListener() { + public void itemStateChanged( ItemEvent evt ) { + if ( ! lockButton.isSelected() ) { + updateMapper(); + } + } + } ); + updateMapper(); + line_ = Box.createHorizontalBox(); + line_.add( lockButton ); + line_.add( Box.createHorizontalStrut( 5 ) ); + line_.add( new ShrinkWrapper( this ) ); + line_.add( Box.createHorizontalStrut( 5 ) ); + line_.add( new ComboBoxBumper( this ) ); + } + + /** + * Returns the component containing this selector plus some decorations + * and auxiliary controls. + * + * @return display component + */ + public JComponent getComponent() { + return line_; + } + + /** + * Updates the state of this component to correspond to the current + * selection status of its associated column selector. + */ + private void updateMapper() { + Object cdata = columnSelector_.getSelectedItem(); + if ( cdata != coldata_ ) { + coldata_ = cdata; + removeAllItems(); + ColumnInfo info = getSelectedColumnInfo(); + Class clazz = info == null ? null : info.getContentClass(); + for ( DomainMapper mapper : mappers_ ) { + if ( mapper == null || clazz == null || + mapper.getSourceClass().isAssignableFrom( clazz ) ) { + addItem( mapper ); + } + } + DomainMapper auto = getAutoValue(); + if ( ! mappers_.contains( auto ) ) { + addItem( auto ); + } + setSelectedItem( auto ); + } + } + + /** + * Returns the default DomainMapper for the currently selected column. + * + * @return default domain mapper for current state + */ + private DomainMapper getAutoValue() { + ColumnInfo info = getSelectedColumnInfo(); + if ( info != null ) { + DomainMapper dm = domain_.getProbableMapper( info ); + if ( dm == null ) { + dm = domain_.getPossibleMapper( info ); + } + return dm; + } + return null; + } + + /** + * Returns the metadata for the selected column, if any. + * + * @return value info for selected column, or null + */ + private ColumnInfo getSelectedColumnInfo() { + Object sel = columnSelector_.getSelectedItem(); + return sel instanceof ColumnData + ? ((ColumnData) sel).getColumnInfo() + : null; + } +} diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/Driver.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/Driver.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/Driver.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/Driver.java 2020-06-04 17:10:04.000000000 +0000 @@ -10,8 +10,6 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; -import java.util.logging.ConsoleHandler; -import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.SwingUtilities; @@ -38,6 +36,7 @@ import uk.ac.starlink.table.gui.TableLoadClient; import uk.ac.starlink.table.gui.TableLoader; import uk.ac.starlink.table.jdbc.TextModelsAuthenticator; +import uk.ac.starlink.task.InvokeUtils; import uk.ac.starlink.topcat.interop.TopcatCommunicator; import uk.ac.starlink.ttools.Stilts; import uk.ac.starlink.util.gui.ErrorDialog; @@ -352,7 +351,7 @@ } /* Configure logging. */ - configureLogging( verbosity, debug ); + InvokeUtils.configureLogging( verbosity, debug ); /* Check JRE vendor and report on concerns. */ Loader.checkJ2seVendor(); @@ -774,60 +773,6 @@ } } - /** - * Sets up the logging system. - * - * @param verbosity number of levels greater than default to set - */ - private static void configureLogging( int verbosity, boolean debug ) { - - /* Try to acquire a custom log handler - may fail for security - * reasons. */ - LogHandler customHandler = LogHandler.getInstance(); - if ( customHandler == null ) { - return; - } - try { - - /* Add a custom log handler. */ - Logger rootLogger = Logger.getLogger( "" ); - rootLogger.addHandler( customHandler ); - - /* Work out the logging level to which the requested verbosity - * corresponds. */ - int verbInt = Math.max( Level.ALL.intValue(), - Level.WARNING.intValue() - - verbosity * - ( Level.WARNING.intValue() - - Level.INFO.intValue() ) ); - Level verbLevel = Level.parse( Integer.toString( verbInt ) ); - - /* Get the root logger's console handler. By default - * it has one of these; if it doesn't then some custom - * logging is in place and we won't mess about with it. */ - Handler[] rootHandlers = rootLogger.getHandlers(); - if ( rootHandlers.length > 0 && - rootHandlers[ 0 ] instanceof ConsoleHandler ) { - rootHandlers[ 0 ].setLevel( verbLevel ); - rootHandlers[ 0 ].setFormatter( new LineFormatter( debug ) ); - } - rootLogger.setLevel( verbLevel ); - - /* Filter out an annoying message that Axis issues. */ - Logger.getLogger( "org.apache.axis.utils.JavaUtils" ) - .setLevel( Level.SEVERE ); - } - - /* I don't think this should happen, since the earlier test should - * already have failed if we don't have permission to muck about - * with logging configuration. However, I don't fully understand - * the logging security model, so maybe it could. */ - catch ( SecurityException e ) { - logger.warning( "Logging configuration failed" + - " - security exception" ); - } - } - /** * Defines configuration options for non-critical startup functions. */ diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/Activity.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/Activity.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/Activity.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/Activity.java 2020-06-04 17:10:04.000000000 +0000 @@ -17,6 +17,5 @@ * * @return target application selection model */ - @SuppressWarnings("rawtypes") - ComboBoxModel getTargetSelector(); + ComboBoxModel getTargetSelector(); } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/ImageActivity.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/ImageActivity.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/ImageActivity.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/ImageActivity.java 2020-06-04 17:10:04.000000000 +0000 @@ -34,8 +34,7 @@ * * @return format selector */ - @SuppressWarnings("rawtypes") - JComboBox getFormatSelector(); + JComboBox getFormatSelector(); /** * Displays an image according to the current selections of the diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/PlasticCommunicator.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/PlasticCommunicator.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/PlasticCommunicator.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/PlasticCommunicator.java 2020-06-04 17:10:04.000000000 +0000 @@ -46,7 +46,6 @@ * @author Mark Taylor * @since 4 Sep 2008 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class PlasticCommunicator implements TopcatCommunicator { private final ControlWindow control_; @@ -142,10 +141,10 @@ } public SkyPointActivity createSkyPointActivity() { - final ComboBoxModel selector = + final ComboBoxModel selector = plasticServer_.createPlasticComboBoxModel( MessageId.SKY_POINT ); return new SkyPointActivity() { - public ComboBoxModel getTargetSelector() { + public ComboBoxModel getTargetSelector() { return selector; } public void pointAtSky( double ra, double dec ) throws IOException { @@ -160,11 +159,11 @@ } public RowActivity createRowActivity() { - final ComboBoxModel selector = + final ComboBoxModel selector = plasticServer_ .createPlasticComboBoxModel( MessageId.VOT_HIGHLIGHTOBJECT ); return new RowActivity() { - public ComboBoxModel getTargetSelector() { + public ComboBoxModel getTargetSelector() { return selector; } public void highlightRow( TopcatModel tcModel, long lrow ) @@ -180,11 +179,11 @@ } public SubsetActivity createSubsetActivity() { - final ComboBoxModel selector = + final ComboBoxModel selector = plasticServer_ .createPlasticComboBoxModel( MessageId.VOT_SHOWOBJECTS ); return new SubsetActivity() { - public ComboBoxModel getTargetSelector() { + public ComboBoxModel getTargetSelector() { return selector; } public void selectSubset( TopcatModel tcModel, RowSubset rset ) @@ -201,10 +200,10 @@ public SpectrumActivity createSpectrumActivity() { final URI msgId = MessageId.SPECTRUM_LOADURL; - final ComboBoxModel selector = + final ComboBoxModel selector = plasticServer_.createPlasticComboBoxModel( msgId ); return new SpectrumActivity() { - public ComboBoxModel getTargetSelector() { + public ComboBoxModel getTargetSelector() { return selector; } public void displaySpectrum( String location, Map metadata ) @@ -214,13 +213,13 @@ item instanceof ApplicationItem ? new URI[] { ((ApplicationItem) item).getId() } : null; - List argList = + List argList = Arrays.asList( new Object[] { location, location, metadata } ); plasticServer_.register(); PlasticHubListener hub = plasticServer_.getHub(); URI plasticId = plasticServer_.getRegisteredId(); - Map responses = ( recipients == null ) + Map responses = ( recipients == null ) ? hub.request( plasticId, msgId, argList ) : hub.requestToSubset( plasticId, msgId, argList, Arrays.asList( recipients ) ); @@ -313,9 +312,10 @@ * the GUI. */ new Thread( "FITS broadcast" ) { public void run() { - List argList = Arrays.asList( new Object[] { tmpUrl, tmpUrl } ); + List argList = + Arrays.asList( new Object[] { tmpUrl, tmpUrl } ); URI msgId = MessageId.FITS_LOADIMAGE; - Map responses = recipients == null + Map responses = recipients == null ? hub.request( plasticId, msgId, argList ) : hub.requestToSubset( plasticId, msgId, argList, Arrays.asList( recipients ) ); diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/PlasticImageActivity.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/PlasticImageActivity.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/PlasticImageActivity.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/PlasticImageActivity.java 2020-06-04 17:10:04.000000000 +0000 @@ -25,13 +25,12 @@ * @author Mark Taylor * @since 18 Sep 2008 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class PlasticImageActivity implements ImageActivity { private final TopcatPlasticListener plasticServer_; - private final JComboBox formatSelector_; + private final JComboBox formatSelector_; private final ViewerComboBoxModel viewerModel_; - private final ComboBoxModel fitsAppModel_; + private final ComboBoxModel fitsAppModel_; /** * Constructor. @@ -40,7 +39,7 @@ */ public PlasticImageActivity( TopcatPlasticListener plasticServer ) { plasticServer_ = plasticServer; - formatSelector_ = new JComboBox( KNOWN_FORMATS ); + formatSelector_ = new JComboBox( KNOWN_FORMATS ); formatSelector_.addItemListener( new ItemListener() { public void itemStateChanged( ItemEvent evt ) { setFormat( String.valueOf( formatSelector_ @@ -55,11 +54,11 @@ setFormat( format ); } - public ComboBoxModel getTargetSelector() { + public ComboBoxModel getTargetSelector() { return viewerModel_; } - public JComboBox getFormatSelector() { + public JComboBox getFormatSelector() { return formatSelector_; } @@ -87,8 +86,8 @@ * ComboBoxModel which displays available viewers. * Elements are all instances of {@link ImageViewer}. */ - private class ViewerComboBoxModel extends AbstractListModel - implements ComboBoxModel { + private class ViewerComboBoxModel extends AbstractListModel + implements ComboBoxModel { private ImageViewer[] baseViewers_; private boolean isFits_; private Object selectedItem_; @@ -149,7 +148,7 @@ + ( isFits_ ? fitsAppModel_.getSize() : 0 ); } - public Object getElementAt( int index ) { + public ImageViewer getElementAt( int index ) { if ( index < baseViewers_.length ) { return baseViewers_[ index ]; } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/SampCommunicator.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/SampCommunicator.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/SampCommunicator.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/SampCommunicator.java 2020-06-04 17:10:04.000000000 +0000 @@ -54,7 +54,6 @@ * @author Mark Taylor * @since 4 Sep 2008 */ -@SuppressWarnings("rawtypes") public class SampCommunicator implements TopcatCommunicator { private final ClientProfile clientProfile_; @@ -144,7 +143,7 @@ final SendManager pointSender = new SendManager( hubConnector_, "coord.pointAt.sky" ); return new SkyPointActivity() { - public ComboBoxModel getTargetSelector() { + public ComboBoxModel getTargetSelector() { return pointSender.getComboBoxModel(); } public void pointAtSky( double ra, double dec ) throws IOException { @@ -160,7 +159,7 @@ final SendManager rowSender = new SendManager( hubConnector_, "table.highlight.row" ); return new RowActivity() { - public ComboBoxModel getTargetSelector() { + public ComboBoxModel getTargetSelector() { return rowSender.getComboBoxModel(); } public void highlightRow( TopcatModel tcModel, long lrow ) @@ -177,7 +176,7 @@ final SendManager subsetSender = new SendManager( hubConnector_, "table.select.rowList" ); return new SubsetActivity() { - public ComboBoxModel getTargetSelector() { + public ComboBoxModel getTargetSelector() { return subsetSender.getComboBoxModel(); } public void selectSubset( TopcatModel tcModel, RowSubset rset ) @@ -195,7 +194,7 @@ final SendManager spectrumSender = new SendManager( hubConnector_, "spectrum.load.ssa-generic" ); return new SpectrumActivity() { - public ComboBoxModel getTargetSelector() { + public ComboBoxModel getTargetSelector() { return spectrumSender.getComboBoxModel(); } public void displaySpectrum( String location, Map metadata ) diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/SampImageActivity.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/SampImageActivity.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/SampImageActivity.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/SampImageActivity.java 2020-06-04 17:10:04.000000000 +0000 @@ -30,12 +30,11 @@ * @author Mark Taylor * @since 18 Sep 2008 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class SampImageActivity implements ImageActivity { private final GuiHubConnector connector_; private final SubscribedClientListModel clientModel_; - private final JComboBox formatSelector_; + private final JComboBox formatSelector_; private final ViewerComboBoxModel viewerModel_; private static final Map mfactMap_ = createMessageFactoryMap(); @@ -47,11 +46,11 @@ */ public SampImageActivity( GuiHubConnector connector ) { connector_ = connector; - formatSelector_ = new JComboBox( KNOWN_FORMATS ); + formatSelector_ = new JComboBox( KNOWN_FORMATS ); formatSelector_.addItemListener( new ItemListener() { public void itemStateChanged( ItemEvent evt ) { - setFormat( String.valueOf( formatSelector_ - .getSelectedItem() ) ); + setFormat( formatSelector_ + .getItemAt( formatSelector_.getSelectedIndex() ) ); } } ); clientModel_ = @@ -62,11 +61,11 @@ setFormat( format ); } - public ComboBoxModel getTargetSelector() { + public ComboBoxModel getTargetSelector() { return viewerModel_; } - public JComboBox getFormatSelector() { + public JComboBox getFormatSelector() { return formatSelector_; } @@ -123,8 +122,8 @@ * ComboBoxModel which displays available viewers. * Elements are all instances of {@link ImageViewer}. */ - private class ViewerComboBoxModel extends AbstractListModel - implements ComboBoxModel { + private class ViewerComboBoxModel extends AbstractListModel + implements ComboBoxModel { private ImageViewer[] baseViewers_; private Object selectedItem_; @@ -233,7 +232,7 @@ return baseViewers_.length + clientModel_.getSize(); } - public Object getElementAt( int index ) { + public ImageViewer getElementAt( int index ) { int nb = baseViewers_.length; if ( index < nb ) { return baseViewers_[ index ]; diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/SelectivePlasticListModel.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/SelectivePlasticListModel.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/SelectivePlasticListModel.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/SelectivePlasticListModel.java 2020-06-04 17:10:04.000000000 +0000 @@ -13,7 +13,8 @@ /** * Implements a ListModel based on an existing ListModel which is taken to - * contain (PLASTIC) {@link uk.ac.starlink.plastic.ApplicationItem} objects. + * contain (PLASTIC) {@link uk.ac.starlink.plastic.ApplicationItem} objects, + * and optionally the {@link #ALL_LISTENERS} string. * The purpose of this class is to give you the subset of the applications * which support a given PLASTIC message ID. * Applications which support all messages are included. @@ -24,12 +25,11 @@ * @author Mark Taylor * @since 22 Apr 2006 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class SelectivePlasticListModel - extends AbstractListModel - implements ListDataListener, ComboBoxModel { + extends AbstractListModel + implements ListDataListener, ComboBoxModel { - private final ListModel base_; + private final ListModel base_; private final URI messageId_; private List appList_; private boolean includeAll_; @@ -51,8 +51,8 @@ * excluded from the list (typically represents the * sender application) */ - public SelectivePlasticListModel( ListModel base, URI messageId, - boolean includeAll, + public SelectivePlasticListModel( ListModel base, + URI messageId, boolean includeAll, HubManager excludeApp ) { base_ = base; messageId_ = messageId; @@ -70,7 +70,7 @@ * Updates state to match that of the base model. */ private void updateItems() { - List list = new ArrayList(); + List list = new ArrayList<>(); /* Optionally include an entry representing a full broadcast. */ if ( includeAll_ ) { diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/SendManager.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/SendManager.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/SendManager.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/SendManager.java 2020-06-04 17:10:04.000000000 +0000 @@ -26,11 +26,10 @@ * @author Mark Taylor * @since 17 Sep 2008 */ -@SuppressWarnings("rawtypes") public class SendManager { private final GuiHubConnector connector_; - private final ListModel clientListModel_; + private final ListModel clientListModel_; private final SendComboBoxModel comboBoxModel_; private final String mtype_; @@ -46,7 +45,10 @@ public SendManager( GuiHubConnector connector, String mtype ) { connector_ = connector; mtype_ = mtype; - clientListModel_ = new SubscribedClientListModel( connector, mtype ); + @SuppressWarnings("unchecked") + ListModel clientListModel = + new SubscribedClientListModel( connector, mtype ); + clientListModel_ = clientListModel; comboBoxModel_ = new SendComboBoxModel( clientListModel_ ); } @@ -56,7 +58,7 @@ * * @return combo box model */ - public ComboBoxModel getComboBoxModel() { + public ComboBoxModel getComboBoxModel() { return comboBoxModel_; } @@ -70,7 +72,7 @@ * * @return list with only Client entries */ - public ListModel getClientListModel() { + public ListModel getClientListModel() { return clientListModel_; } @@ -132,9 +134,9 @@ * It essentially mirrors an existing client model but prepends a * broadcast option. */ - private static class SendComboBoxModel extends AbstractListModel - implements ComboBoxModel { - private final ListModel clientListModel_; + private static class SendComboBoxModel extends AbstractListModel + implements ComboBoxModel { + private final ListModel clientListModel_; private final Object broadcast_; private Object selectedItem_; @@ -144,7 +146,7 @@ * @param clientListModel list model containing suitable * {@link org.astrogrid.samp.Client}s */ - SendComboBoxModel( ListModel clientListModel ) { + SendComboBoxModel( ListModel clientListModel ) { clientListModel_ = clientListModel; broadcast_ = new Object() { @Override diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/TablePullHandler.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/TablePullHandler.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/TablePullHandler.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/TablePullHandler.java 2020-06-04 17:10:04.000000000 +0000 @@ -139,12 +139,10 @@ return cwin.getCurrentModel(); } else { - @SuppressWarnings("rawtypes") - ListModel listModel = cwin.getTablesListModel(); + ListModel listModel = cwin.getTablesListModel(); int nt = listModel.getSize(); for ( int it = 0; it < nt; it++ ) { - TopcatModel tcModel = - (TopcatModel) listModel.getElementAt( it ); + TopcatModel tcModel = listModel.getElementAt( it ); if ( tcModel.getID() == id ) { return tcModel; } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/TopcatPlasticListener.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/TopcatPlasticListener.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/TopcatPlasticListener.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/TopcatPlasticListener.java 2020-06-04 17:10:04.000000000 +0000 @@ -54,12 +54,12 @@ * @since 8 Feb 2006 * @see PLASTIC */ -@SuppressWarnings({"unchecked","rawtypes"}) public class TopcatPlasticListener extends HubManager { private final ControlWindow controlWindow_; private final Map idMap_; private final Map highlightMap_; + private final ListModel appList_; private static final URI[] SUPPORTED_MESSAGES = new URI[] { MessageId.VOT_LOAD, @@ -83,6 +83,10 @@ idMap_ = Collections .synchronizedMap( new HashMap() ); highlightMap_ = new HashMap(); + @SuppressWarnings("unchecked") + ListModel typedAppList = + (ListModel) getApplicationListModel(); + appList_ = typedAppList; } /** @@ -93,6 +97,7 @@ * @param args message argument list * @return return value requested by message */ + @SuppressWarnings("rawtypes") public Object doPerform( URI sender, URI message, List args ) throws IOException { @@ -163,9 +168,8 @@ * @param messageId message which must be supported * @return selection model */ - public ComboBoxModel createPlasticComboBoxModel( URI messageId ) { - return new SelectivePlasticListModel( getApplicationListModel(), - messageId, true, this ); + public ComboBoxModel createPlasticComboBoxModel( URI messageId ) { + return new SelectivePlasticListModel( appList_, messageId, true, this ); } /** @@ -759,11 +763,10 @@ return tr; } else { - ListModel tablesList = + ListModel tablesList = ControlWindow.getInstance().getTablesListModel(); for ( int i = 0; i < tablesList.getSize(); i++ ) { - TopcatModel tcModel = - (TopcatModel) tablesList.getElementAt( i ); + TopcatModel tcModel = tablesList.getElementAt( i ); URL url = tcModel.getDataModel().getBaseTable().getURL(); if ( URLUtils.sameResource( url, URLUtils.makeURL( tableId ) ) ) { @@ -774,6 +777,7 @@ return null; } + /** * Returns the name of a registered application which has a given ID. * If no such application is registered, some general string like @@ -784,9 +788,8 @@ */ private String getAppName( URI id ) { String name = null; - ListModel appList = getApplicationListModel(); - for ( int i = 0; i < appList.getSize(); i++ ) { - ApplicationItem app = (ApplicationItem) appList.getElementAt( i ); + for ( int i = 0; i < appList_.getSize(); i++ ) { + ApplicationItem app = appList_.getElementAt( i ); if ( app.getId().equals( id ) ) { return app.getName(); } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/TopcatSampControl.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/TopcatSampControl.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/interop/TopcatSampControl.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/interop/TopcatSampControl.java 2020-06-04 17:10:04.000000000 +0000 @@ -274,8 +274,6 @@ * be used in SAMP messages that reference a table using the * table-id/url message parameter * (table.highlight.row, table.select.rowList). - * Elements of the returned list are - * {@link uk.ac.starlink.topcat.TopcatModel}s. * * TopcatModels may be added to this list when they have been involved * in a relevant SAMP message (usually table.load.*). @@ -284,8 +282,7 @@ * * @return listmodel of identifiable tables */ - @SuppressWarnings("rawtypes") - public ListModel getIdentifiableTableListModel() { + public ListModel getIdentifiableTableListModel() { return idListModel_; } @@ -575,13 +572,11 @@ /* If that fails, examine the URL. */ else if ( url != null ) { - @SuppressWarnings("rawtypes") - ListModel tablesList = + ListModel tablesList = ControlWindow.getInstance().getTablesListModel(); URL u = new URL( url ); for ( int i = 0; i < tablesList.getSize(); i++ ) { - TopcatModel tcModel = - (TopcatModel) tablesList.getElementAt( i ); + TopcatModel tcModel = tablesList.getElementAt( i ); if ( URLUtils.sameResource( u, tcModel.getDataModel() .getBaseTable().getURL() ) ) { return new TableWithRows( tcModel, null ); @@ -1036,8 +1031,7 @@ * Listeners to this list will be notified when the contents * may have changed. */ - @SuppressWarnings("rawtypes") - private class TableIdListModel extends AbstractListModel { + private class TableIdListModel extends AbstractListModel { volatile TopcatModel[] list_; TableIdListModel() { @@ -1073,9 +1067,9 @@ for ( TableWithRows twr : idMap_.values() ) { set.add( twr.getTable() ); } - ListModel tlist = controlWindow_.getTablesListModel(); + ListModel tlist = controlWindow_.getTablesListModel(); for ( int i = 0; i < tlist.getSize(); i++ ) { - TopcatModel tcm = (TopcatModel) tlist.getElementAt( i ); + TopcatModel tcm = tlist.getElementAt( i ); if ( ! set.contains( tcm ) && tcm.getViewModel().getRowMap() == null && tcm.getDataModel().getBaseTable().getURL() != null ) { diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/IntSelector.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/IntSelector.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/IntSelector.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/IntSelector.java 2020-06-04 17:10:04.000000000 +0000 @@ -17,10 +17,9 @@ * @author Mark Taylor (Starlink) * @since 7 Oct 2004 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class IntSelector extends JPanel implements ItemListener { - private final JComboBox cbox_; + private final JComboBox cbox_; private int selected_; /** @@ -33,14 +32,14 @@ super( new BorderLayout() ); if ( options != null ) { int nopt = options.length; - Object[] items = new Object[ nopt ]; + Integer[] items = new Integer[ nopt ]; for ( int i = 0; i < nopt; i++ ) { items[ i ] = new Integer( options[ i ] ); } - cbox_ = new JComboBox( items ); + cbox_ = new JComboBox( items ); } else { - cbox_ = new JComboBox(); + cbox_ = new JComboBox(); } cbox_.setEditable( true ); cbox_.addItemListener( this ); @@ -76,7 +75,7 @@ * * @return combo box */ - public JComboBox getComboBox() { + public JComboBox getComboBox() { return cbox_; } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/JList2.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/JList2.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/JList2.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/JList2.java 2020-06-04 17:10:04.000000000 +0000 @@ -19,13 +19,14 @@ /** * Contains two adjacent vertical JLists in the same component. + * This is a presentation component, not concerned with access to + * the data in the contained lists. * Scrolling is taken care of. */ -@SuppressWarnings({"unchecked","rawtypes"}) public class JList2 extends JPanel implements Scrollable { - private final JList list1_; - private final JList list2_; + private final JList list1_; + private final JList list2_; /** * Constructor. @@ -33,7 +34,7 @@ * @param list1 first list * @param list2 second list */ - public JList2( JList list1, JList list2 ) { + public JList2( JList list1, JList list2 ) { super( new GridBagLayout() ); list1_ = list1; list2_ = list2; diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/CdsTableSelector.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/CdsTableSelector.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/CdsTableSelector.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/CdsTableSelector.java 2020-06-04 17:10:04.000000000 +0000 @@ -38,10 +38,9 @@ * @author Mark Taylor * @since 15 May 2014 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class CdsTableSelector extends JPanel { - private final JComboBox nameSelector_; + private final JComboBox nameSelector_; private final VizierMetaDownloader metaDownloader_; private final MocDownloader mocDownloader_; private final JTextField nameField_; @@ -66,7 +65,7 @@ setLayout( new BorderLayout() ); /* Add selector component. */ - nameSelector_ = new JComboBox() { + nameSelector_ = new JComboBox() { /* If the catalogue names when they are eventually downloaded * are too long for the width of the window, make sure that @@ -208,7 +207,8 @@ * Must be invoked from the Event Dispatch Thread. */ private void updateTableName() { - String tableName = (String) nameSelector_.getSelectedItem(); + String tableName = + nameSelector_.getItemAt( nameSelector_.getSelectedIndex() ); tableName_ = tableName; setMetadata( null ); setMoc( null ); diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/ConeMultiWindow.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/ConeMultiWindow.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/ConeMultiWindow.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/ConeMultiWindow.java 2020-06-04 17:10:04.000000000 +0000 @@ -21,6 +21,7 @@ import uk.ac.starlink.vo.Capability; import uk.ac.starlink.vo.ConeSearch; import uk.ac.starlink.vo.ConeVerbosity; +import uk.ac.starlink.vo.RegistryPanel; /** * DalMultiWindow subclass for Cone Search services. @@ -45,9 +46,8 @@ */ private static class ConeMultiService implements DalMultiService { - @SuppressWarnings({"unchecked","rawtypes"}) - private final JComboBox verbSelector_ = - new JComboBox( ConeVerbosity.getOptions() ); + private final JComboBox verbSelector_ = + new JComboBox<>( ConeVerbosity.getOptions() ); private final JComponent controlBox_; @@ -109,9 +109,17 @@ return controlBox_; } + public JComponent getVersionComponent() { + return null; + } + + public void init( RegistryPanel regPanel ) { + } + public ConeSearcher createSearcher( URL url, StarTableFactory tfact, ContentCoding coding ) { - int verb = ((ConeVerbosity) verbSelector_.getSelectedItem()) + int verb = verbSelector_ + .getItemAt( verbSelector_.getSelectedIndex() ) .getLevel(); return new ServiceConeSearcher( new ConeSearch( url.toString(), coding ), diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/DalMultiPanel.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/DalMultiPanel.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/DalMultiPanel.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/DalMultiPanel.java 2020-06-04 17:10:04.000000000 +0000 @@ -76,7 +76,6 @@ * @author Mark Taylor * @since 29 Sep 2009 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class DalMultiPanel extends JPanel { private final DalMultiService service_; @@ -90,14 +89,15 @@ private final ColumnSelector raSelector_; private final ColumnSelector decSelector_; private final ColumnSelector srSelector_; - private final JComboBox modeSelector_; + private final JComboBox modeSelector_; private final SpinnerNumberModel parallelModel_; - private final JComboBox erractSelector_; + private final JComboBox erractSelector_; private final Action startAction_; private final Action stopAction_; private final JComponent[] components_; private final TopcatListener tcListener_; private final ToggleButtonModel coverageModel_; + private final JComponent urlLine_; private Coverage lastCoverage_; private URL lastCoverageUrl_; private TopcatModel tcModel_; @@ -133,19 +133,21 @@ /* Field for service URL. */ urlField_ = new JTextField(); JLabel urlLabel = new JLabel( service.getName() + " URL: " ); - Box urlLine = Box.createHorizontalBox(); + urlLine_ = Box.createHorizontalBox(); cList.add( urlField_ ); cList.add( urlLabel ); - urlLine.add( urlLabel ); - urlLine.add( urlField_ ); - main.add( urlLine ); + urlLine_.add( urlLabel ); + urlLine_.add( urlField_ ); + main.add( urlLine_ ); main.add( Box.createVerticalStrut( 10 ) ); /* Field for input table. */ - final JComboBox tableSelector = new TablesListComboBox( 250 ); + final JComboBox tableSelector = + new TablesListComboBox( 250 ); tableSelector.addItemListener( new ItemListener() { public void itemStateChanged( ItemEvent evt ) { - setInputTable( (TopcatModel) tableSelector.getSelectedItem() ); + setInputTable( tableSelector + .getItemAt( tableSelector.getSelectedIndex() ) ); } } ); JLabel tableLabel = new JLabel( "Input Table: " ); @@ -211,7 +213,7 @@ /* Multicone output mode selector. */ main.add( Box.createVerticalStrut( 10 ) ); - modeSelector_ = new JComboBox( getMulticoneModes() ); + modeSelector_ = new JComboBox( getMulticoneModes() ); Box modeLine = Box.createHorizontalBox(); JLabel modeLabel = new JLabel( "Output Mode: " ); modeLine.add( modeLabel ); @@ -243,8 +245,8 @@ public void focusGained( FocusEvent evt ) { } } ); - urlLine.add( Box.createHorizontalStrut( 5 ) ); - urlLine.add( serviceCoverageView_ ); + urlLine_.add( Box.createHorizontalStrut( 5 ) ); + urlLine_.add( serviceCoverageView_ ); /* Table coverage icon. */ queryCoverageView_ = new CoverageView( "table" ); @@ -312,7 +314,8 @@ JSpinner parallelSpinner = new JSpinner( parallelModel_ ); cList.add( parallelLabel ); cList.add( parallelSpinner ); - erractSelector_ = new JComboBox( getConeErrorPolicies( service ) ); + erractSelector_ = + new JComboBox( getConeErrorPolicies( service ) ); JLabel erractLabel = new JLabel( ERRACT_LABEL + ": " ); cList.add( erractLabel ); cList.add( erractSelector_ ); @@ -359,6 +362,15 @@ } /** + * Returns the component in which the URL selector is located. + * + * @return URL selector container + */ + public JComponent getServiceUrlBox() { + return urlLine_; + } + + /** * Update the service coverage component if the currently selected * service URL has changed. */ @@ -523,7 +535,8 @@ Object conv = srSelector_.getModel().getConverterModel() .getSelectedItem(); srSelector_.setTable( tcModel ); - ComboBoxModel srColModel = srSelector_.getModel().getColumnModel(); + ComboBoxModel srColModel = + srSelector_.getModel().getColumnModel(); assert srColModel instanceof ColumnDataComboBoxModel; if ( srColModel instanceof ColumnDataComboBoxModel ) { try { @@ -613,7 +626,7 @@ .initCause( e ); } ConeErrorPolicy erract = - (ConeErrorPolicy) erractSelector_.getSelectedItem(); + erractSelector_.getItemAt( erractSelector_.getSelectedIndex() ); TopcatModel tcModel = tcModel_; if ( tcModel == null ) { throw new NullPointerException( "No table selected" ); @@ -636,7 +649,8 @@ } Number parNum = parallelModel_.getNumber(); int parallelism = parNum == null ? 1 : parNum.intValue(); - MulticoneMode mcMode = (MulticoneMode) modeSelector_.getSelectedItem(); + MulticoneMode mcMode = + modeSelector_.getItemAt( modeSelector_.getSelectedIndex() ); StarTableFactory tfact = ControlWindow.getInstance().getTableFactory(); /* Assemble objects based on this information. */ diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/DalMultiService.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/DalMultiService.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/DalMultiService.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/DalMultiService.java 2020-06-04 17:10:04.000000000 +0000 @@ -10,6 +10,7 @@ import uk.ac.starlink.ttools.cone.Coverage; import uk.ac.starlink.util.ContentCoding; import uk.ac.starlink.vo.Capability; +import uk.ac.starlink.vo.RegistryPanel; /** * Defines service-type-specific aspects of how to do a multiple query @@ -81,6 +82,21 @@ JComponent getControlPanel(); /** + * Returns a panel used for protocol version selection, if available. + * + * @return version selector component, or null + */ + JComponent getVersionComponent(); + + /** + * Performs any required initialisation based on the registry panel + * that will be associated with this service. + * + * @param regPanel panel used for service selection + */ + void init( RegistryPanel regPanel ); + + /** * Constructs a cone searcher object for this service type. * * @param url service URL diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/DalMultiWindow.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/DalMultiWindow.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/DalMultiWindow.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/DalMultiWindow.java 2020-06-04 17:10:04.000000000 +0000 @@ -10,6 +10,7 @@ import java.util.logging.Logger; import javax.swing.Action; import javax.swing.BorderFactory; +import javax.swing.Box; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JMenu; @@ -84,6 +85,12 @@ * service. */ final DalMultiPanel multiPanel = new DalMultiPanel( service, placeProgressBar() ); + JComponent versionBox = service.getVersionComponent(); + if ( versionBox != null ) { + JComponent urlBox = multiPanel.getServiceUrlBox(); + urlBox.add( Box.createHorizontalStrut( 10 ) ); + urlBox.add( versionBox ); + } /* Arrange for the multiquery panel to get updated when a service * is selected from the registry panel. */ @@ -104,6 +111,7 @@ .addListSelectionListener( serviceSelListener ); regPanel_.getCapabilitySelectionModel() .addListSelectionListener( serviceSelListener ); + service.init( regPanel_ ); /* Cosmetics. */ regPanel_.setBorder( diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/JoinFixSelector.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/JoinFixSelector.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/JoinFixSelector.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/JoinFixSelector.java 2020-06-04 17:10:04.000000000 +0000 @@ -16,17 +16,16 @@ * @author Mark Taylor * @since 16 Jun 2014 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class JoinFixSelector extends JPanel { - private final JComboBox scopeSelector_; + private final JComboBox scopeSelector_; private final JTextField suffixField_; /** * Constructor. */ JoinFixSelector() { - scopeSelector_ = new JComboBox( Scope.values() ); + scopeSelector_ = new JComboBox( Scope.values() ); scopeSelector_.addItemListener( new ItemListener() { public void itemStateChanged( ItemEvent evt ) { Scope scope = (Scope) scopeSelector_.getSelectedItem(); @@ -48,7 +47,8 @@ * @return join fix action */ public JoinFixAction getJoinFixAction() { - Scope scope = (Scope) scopeSelector_.getSelectedItem(); + Scope scope = + scopeSelector_.getItemAt( scopeSelector_.getSelectedIndex() ); String suffix = suffixField_.getText(); return scope.createFixAct( suffix ); } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/MatchPlotter.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/MatchPlotter.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/MatchPlotter.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/MatchPlotter.java 2020-06-04 17:10:04.000000000 +0000 @@ -12,6 +12,7 @@ import java.util.Map; import javax.swing.Action; import javax.swing.JOptionPane; +import javax.swing.ListModel; import uk.ac.starlink.table.JoinFixAction; import uk.ac.starlink.table.StarTable; import uk.ac.starlink.table.ValueInfo; @@ -22,7 +23,6 @@ import uk.ac.starlink.topcat.RowSubset; import uk.ac.starlink.topcat.TopcatModel; import uk.ac.starlink.topcat.TupleSelector; -import uk.ac.starlink.topcat.TypedListModel; import uk.ac.starlink.topcat.plot2.ControlManager; import uk.ac.starlink.topcat.plot2.CubePlotWindow; import uk.ac.starlink.topcat.plot2.LayerCommand; @@ -95,7 +95,7 @@ * @return match plotter instance, or null if we don't know how to do it */ public static MatchPlotter getMatchPlotter( MatchEngine engine ) { - final TypedListModel tablesModel = + final ListModel tablesModel = ControlWindow.getInstance().getTablesListModel(); /* Get the names of the coordinates which are required by the diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/MatchWindow.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/MatchWindow.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/MatchWindow.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/MatchWindow.java 2020-06-04 17:10:04.000000000 +0000 @@ -27,6 +27,7 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import uk.ac.starlink.table.join.AnisotropicCartesianMatchEngine; +import uk.ac.starlink.table.join.CdsHealpixSkyPixellator; import uk.ac.starlink.table.join.CombinedMatchEngine; import uk.ac.starlink.table.join.CuboidCartesianMatchEngine; import uk.ac.starlink.table.join.EllipseCartesianMatchEngine; @@ -37,7 +38,6 @@ import uk.ac.starlink.table.join.HtmSkyPixellator; import uk.ac.starlink.table.join.IsotropicCartesianMatchEngine; import uk.ac.starlink.table.join.MatchEngine; -import uk.ac.starlink.table.join.PixtoolsHealpixSkyPixellator; import uk.ac.starlink.table.join.ProgressIndicator; import uk.ac.starlink.table.join.RangeModelProgressIndicator; import uk.ac.starlink.table.join.ErrorSkyMatchEngine; @@ -55,11 +55,10 @@ * * @author Mark Taylor (Starlink) */ -@SuppressWarnings({"unchecked","rawtypes"}) public class MatchWindow extends AuxWindow implements ItemListener { private final int nTable; - private final JComboBox engineSelector; + private final JComboBox engineSelector; private final Map matchSpecs; private final CardLayout paramCards; private final JComponent paramContainer; @@ -98,7 +97,7 @@ } /* Prepare a combo box which can select the engines. */ - engineSelector = new JComboBox( engines ); + engineSelector = new JComboBox( engines ); engineSelector.addItemListener( this ); /* Set up an action to start the match. */ @@ -204,7 +203,7 @@ * @return match engine */ private MatchEngine getMatchEngine() { - return (MatchEngine) engineSelector.getSelectedItem(); + return engineSelector.getItemAt( engineSelector.getSelectedIndex() ); } /** @@ -438,14 +437,14 @@ Arrays.fill( someLengths4, someLength ); MatchEngine skyPlus1Engine = createCombinedEngine( "Sky + X", new MatchEngine[] { - new FixedSkyMatchEngine( new PixtoolsHealpixSkyPixellator(), + new FixedSkyMatchEngine( new CdsHealpixSkyPixellator(), someAngle ), new AnisotropicCartesianMatchEngine( someLengths1 ), } ); MatchEngine skyPlus2Engine = createCombinedEngine( "Sky + XY", new MatchEngine[] { - new FixedSkyMatchEngine( new PixtoolsHealpixSkyPixellator(), + new FixedSkyMatchEngine( new CdsHealpixSkyPixellator(), someAngle ), new AnisotropicCartesianMatchEngine( someLengths2 ), } @@ -457,11 +456,9 @@ } }; return new MatchEngine[] { - new FixedSkyMatchEngine( new PixtoolsHealpixSkyPixellator(), - someAngle ), - new ErrorSkyMatchEngine( new PixtoolsHealpixSkyPixellator(), - someAngle ), - new EllipseSkyMatchEngine( new PixtoolsHealpixSkyPixellator(), + new FixedSkyMatchEngine( new CdsHealpixSkyPixellator(), someAngle ), + new ErrorSkyMatchEngine( new CdsHealpixSkyPixellator(), someAngle ), + new EllipseSkyMatchEngine( new CdsHealpixSkyPixellator(), someAngle ), new SphericalPolarMatchEngine( someLength ), new EqualsMatchEngine(), diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/OverlapCoverage.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/OverlapCoverage.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/OverlapCoverage.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/OverlapCoverage.java 2020-06-04 17:10:04.000000000 +0000 @@ -3,7 +3,7 @@ import cds.moc.HealpixMoc; import java.io.IOException; import uk.ac.starlink.ttools.cone.MocCoverage; -import uk.ac.starlink.ttools.cone.PixtoolsHealpix; +import uk.ac.starlink.ttools.cone.CdsHealpix; /** * Footprint implementation that represents the overlap of two other @@ -24,7 +24,7 @@ * @param coverages whose intersection defines the new coverage */ public OverlapCoverage( MocCoverage[] coverages ) { - super( PixtoolsHealpix.getInstance() ); + super( CdsHealpix.getInstance() ); coverages_ = coverages; } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/PairMatchSpec.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/PairMatchSpec.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/PairMatchSpec.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/PairMatchSpec.java 2020-06-04 17:10:04.000000000 +0000 @@ -242,18 +242,17 @@ tcModels[ 1 ].toString() ) ); } - @SuppressWarnings({"unchecked","rawtypes"}) private static class JoinSelector extends Box { - final JComboBox jCombo_; + final JComboBox jCombo_; JoinSelector() { super( BoxLayout.X_AXIS ); - jCombo_ = new JComboBox( JoinType.getPairTypes() ); + jCombo_ = new JComboBox( JoinType.getPairTypes() ); jCombo_.setSelectedItem( JoinType._1AND2 ); add( new JLabel( "Join Type: " ) ); add( jCombo_ ); } JoinType getJoinType() { - return (JoinType) jCombo_.getSelectedItem(); + return jCombo_.getItemAt( jCombo_.getSelectedIndex() ); } } } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/PairModeSelector.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/PairModeSelector.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/PairModeSelector.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/PairModeSelector.java 2020-06-04 17:10:04.000000000 +0000 @@ -7,6 +7,7 @@ import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.JList; +import javax.swing.ListCellRenderer; import org.xml.sax.SAXException; import uk.ac.starlink.table.join.PairMode; import uk.ac.starlink.ttools.Formatter; @@ -18,31 +19,32 @@ * @author Mark Taylor * @since 17 Apr 2009 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class PairModeSelector extends Box { private final JLabel label_; - private final JComboBox comboBox_; + private final JComboBox comboBox_; /** * Constructor. */ public PairModeSelector() { super( BoxLayout.X_AXIS ); - comboBox_ = new JComboBox( PairMode.values() ); - comboBox_.setRenderer( new DefaultListCellRenderer() { + comboBox_ = new JComboBox( PairMode.values() ); + final DefaultListCellRenderer baseRenderer = + new DefaultListCellRenderer(); + comboBox_.setRenderer( new ListCellRenderer() { Formatter formatter_ = new Formatter(); - public Component getListCellRendererComponent( JList list, - Object value, int ix, - boolean isSel, - boolean hasFocus ) { + public Component getListCellRendererComponent( + JList list, PairMode mode, int ix, + boolean isSel, boolean hasFocus ) { Component c = - super.getListCellRendererComponent( list, value, ix, isSel, - hasFocus ); + baseRenderer + .getListCellRendererComponent( list, mode, ix, isSel, + hasFocus ); String ttip = null; - if ( value instanceof PairMode ) { - PairMode mode = (PairMode) value; - setText( mode.getSummary() ); + if ( c instanceof JLabel) { + JLabel label = (JLabel) c; + label.setText( mode.getSummary() ); String desc = FindModeParameter.getModeDescription( mode ); try { ttip = "" @@ -53,8 +55,8 @@ catch ( SAXException e ) { ttip = null; } + label.setToolTipText( ttip ); } - setToolTipText( ttip ); return c; } } ); @@ -70,7 +72,7 @@ * @return mode */ public PairMode getMode() { - return (PairMode) comboBox_.getSelectedItem(); + return comboBox_.getItemAt( comboBox_.getSelectedIndex() ); } @Override diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/ParameterEditor.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/ParameterEditor.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/ParameterEditor.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/ParameterEditor.java 2020-06-04 17:10:04.000000000 +0000 @@ -25,12 +25,11 @@ * @author Mark Taylor (Starlink) * @since 20 Mar 2004 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class ParameterEditor extends JComponent { private final DescribedValue dval_; private final JTextField field_; - private final JComboBox conversionChooser_; + private final JComboBox conversionChooser_; private final ValueCodec codec0_; private final List listenerList_; @@ -70,7 +69,7 @@ ValueCodec[] codecs = ValueCodec.getCodecs( info ); if ( codecs.length > 1 ) { codec0_ = null; - conversionChooser_ = new JComboBox( codecs ); + conversionChooser_ = new JComboBox( codecs ); conversionChooser_.setSelectedIndex( 0 ); conversionChooser_.addActionListener( updateListener ); conversionChooser_.setToolTipText( "Units for " + info.getName() ); @@ -116,7 +115,8 @@ return codec0_; } else { - return (ValueCodec) conversionChooser_.getSelectedItem(); + return conversionChooser_ + .getItemAt( conversionChooser_.getSelectedIndex() ); } } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/SiaMultiWindow.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/SiaMultiWindow.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/SiaMultiWindow.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/SiaMultiWindow.java 2020-06-04 17:10:04.000000000 +0000 @@ -8,6 +8,8 @@ import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JPanel; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; import uk.ac.starlink.table.DefaultValueInfo; import uk.ac.starlink.table.StarTableFactory; import uk.ac.starlink.table.ValueInfo; @@ -18,6 +20,10 @@ import uk.ac.starlink.util.ContentCoding; import uk.ac.starlink.util.gui.ShrinkWrapper; import uk.ac.starlink.vo.Capability; +import uk.ac.starlink.vo.RegCapabilityInterface; +import uk.ac.starlink.vo.RegistryPanel; +import uk.ac.starlink.vo.SiaFormatOption; +import uk.ac.starlink.vo.SiaVersion; import uk.ac.starlink.vo.SiapTableLoadDialog; /** @@ -43,19 +49,22 @@ */ private static class SiaMultiService implements DalMultiService { - @SuppressWarnings({"unchecked","rawtypes"}) - private final JComboBox formatSelector_ - = new JComboBox( SiapTableLoadDialog.getFormatOptions() ); - + private final JComboBox formatSelector_; + private final JComboBox versionSelector_; private final JComponent controlBox_; + private final JComponent versionBox_; /** * Constructor. */ SiaMultiService() { + formatSelector_ = + new JComboBox( SiaFormatOption.getStandardOptions() ); formatSelector_.setSelectedIndex( 0 ); formatSelector_.setEditable( true ); + versionSelector_ = new JComboBox<>( SiaVersion.values() ); + final JLabel formatLabel = new JLabel( "Image Format: " ); controlBox_ = new JPanel() { public void setEnabled( boolean enabled ) { @@ -71,6 +80,10 @@ line.add( new ShrinkWrapper( formatSelector_ ) ); line.add( Box.createHorizontalGlue() ); controlBox_.add( line ); + + versionBox_ = Box.createHorizontalBox(); + versionBox_.add( new JLabel( "SIA Version: " ) ); + versionBox_.add( new ShrinkWrapper( versionSelector_ ) ); } public String getName() { @@ -112,11 +125,38 @@ return controlBox_; } + public JComponent getVersionComponent() { + return versionBox_; + } + + public void init( final RegistryPanel regPanel ) { + ListSelectionListener servListener = new ListSelectionListener() { + public void valueChanged( ListSelectionEvent evt ) { + RegCapabilityInterface[] intfs = + regPanel.getSelectedCapabilities(); + if ( intfs.length == 1 ) { + SiaVersion vers = SiaVersion.forInterface( intfs[ 0 ] ); + if ( vers != null ) { + versionSelector_.setSelectedItem( vers ); + } + } + } + }; + regPanel.getResourceSelectionModel() + .addListSelectionListener( servListener ); + regPanel.getCapabilitySelectionModel() + .addListSelectionListener( servListener ); + } + public ConeSearcher createSearcher( URL url, StarTableFactory tfact, ContentCoding coding ) { - String format = (String) formatSelector_.getSelectedItem(); - return new SiaConeSearcher( url.toString(), format, false, tfact, - coding ); + SiaVersion version = + versionSelector_ + .getItemAt( versionSelector_.getSelectedIndex() ); + SiaFormatOption format = + SiaFormatOption.fromObject( formatSelector_.getSelectedItem() ); + return new SiaConeSearcher( url.toString(), version, format, + false, tfact, coding ); } public boolean hasCoverages() { diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/SsaMultiWindow.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/SsaMultiWindow.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/SsaMultiWindow.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/SsaMultiWindow.java 2020-06-04 17:10:04.000000000 +0000 @@ -18,6 +18,7 @@ import uk.ac.starlink.util.ContentCoding; import uk.ac.starlink.util.gui.ShrinkWrapper; import uk.ac.starlink.vo.Capability; +import uk.ac.starlink.vo.RegistryPanel; import uk.ac.starlink.vo.SsapTableLoadDialog; /** @@ -43,9 +44,8 @@ */ private static class SsaMultiService implements DalMultiService { - @SuppressWarnings({"unchecked","rawtypes"}) - private final JComboBox formatSelector_ - = new JComboBox( SsapTableLoadDialog.getFormatOptions() ); + private final JComboBox formatSelector_ + = new JComboBox( SsapTableLoadDialog.getFormatOptions() ); private final JComponent controlBox_; @@ -112,6 +112,13 @@ return controlBox_; } + public JComponent getVersionComponent() { + return null; + } + + public void init( RegistryPanel regPanel ) { + } + public ConeSearcher createSearcher( URL url, StarTableFactory tfact, ContentCoding coding ) { String format = (String) formatSelector_.getSelectedItem(); diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/UploadMatchPanel.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/UploadMatchPanel.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/join/UploadMatchPanel.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/join/UploadMatchPanel.java 2020-06-04 17:10:04.000000000 +0000 @@ -66,7 +66,6 @@ * * @author Mark Taylor */ -@SuppressWarnings({"unchecked","rawtypes"}) public class UploadMatchPanel extends JPanel { private final JProgressBar progBar_; @@ -74,8 +73,8 @@ private final ColumnSelector raSelector_; private final ColumnSelector decSelector_; private final DoubleValueField srField_; - private final JComboBox blockSelector_; - private final JComboBox modeSelector_; + private final JComboBox blockSelector_; + private final JComboBox modeSelector_; private final JoinFixSelector fixSelector_; private final JComponent[] components_; private final Action startAction_; @@ -144,10 +143,12 @@ main.add( paramBox ); /* Field for input table. */ - final JComboBox tableSelector = new TablesListComboBox( 200 ); + final JComboBox tableSelector = + new TablesListComboBox( 200 ); tableSelector.addItemListener( new ItemListener() { public void itemStateChanged( ItemEvent evt ) { - setInputTable( (TopcatModel) tableSelector.getSelectedItem() ); + setInputTable( tableSelector + .getItemAt( tableSelector.getSelectedIndex() ) ); } } ); cList.add( tableSelector ); @@ -205,7 +206,7 @@ /* Find mode selector. */ Box modeLine = Box.createHorizontalBox(); - modeSelector_ = new JComboBox( UploadFindMode.getInstances() ); + modeSelector_ = new JComboBox<>( UploadFindMode.getInstances() ); modeLine.add( new JLabel( "Find mode: " ) ); modeLine.add( new ShrinkWrapper( modeSelector_ ) ); modeLine.add( Box.createHorizontalGlue() ); @@ -226,7 +227,7 @@ /* Block size selector. */ Box blockLine = Box.createHorizontalBox(); - blockSelector_ = new JComboBox(); + blockSelector_ = new JComboBox(); for ( int i = 0; i < BLOCK_SIZES.length; i++ ) { blockSelector_.addItem( Integer.toString( BLOCK_SIZES[ i ] ) ); } @@ -425,7 +426,7 @@ throw new IllegalArgumentException( "Bad blocksize: " + bfTxt ); } UploadFindMode upMode = - (UploadFindMode) modeSelector_.getSelectedItem(); + modeSelector_.getItemAt( modeSelector_.getSelectedIndex() ); ServiceFindMode serviceMode = upMode.getServiceMode(); long maxrec = MAXREC; String surl = CdsUploadMatcher.XMATCH_URL; diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ListModel2.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ListModel2.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ListModel2.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ListModel2.java 2020-06-04 17:10:04.000000000 +0000 @@ -12,11 +12,10 @@ * @author Mark Taylor * @since 10 May 2018 */ -@SuppressWarnings("rawtypes") -public class ListModel2 extends AbstractListModel { +public class ListModel2 extends AbstractListModel { - private final ListModel model1_; - private final ListModel model2_; + private final ListModel model1_; + private final ListModel model2_; /** * Constructor. @@ -24,7 +23,7 @@ * @param model1 first constituent model * @param model2 second constituend model */ - public ListModel2( ListModel model1, ListModel model2 ) { + public ListModel2( ListModel model1, ListModel model2 ) { model1_ = model1; model2_ = model2; model1.addListDataListener( new OffsetListDataListener() { @@ -44,7 +43,7 @@ * * @return model 1 */ - public ListModel getModel1() { + public ListModel getModel1() { return model1_; } @@ -53,11 +52,11 @@ * * @return model 2 */ - public ListModel getModel2() { + public ListModel getModel2() { return model2_; } - public Object getElementAt( int ix ) { + public E getElementAt( int ix ) { int ix2 = ix - model1_.getSize(); return ix2 >= 0 ? model2_.getElementAt( ix2 ) : model1_.getElementAt( ix ); diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/LoadingList.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/LoadingList.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/LoadingList.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/LoadingList.java 2020-06-04 17:10:04.000000000 +0000 @@ -19,15 +19,14 @@ * @author Mark Taylor * @since 9 April 2009 */ -@SuppressWarnings({"unchecked","rawtypes"}) -public class LoadingList extends JList { +public class LoadingList extends JList { /** * Constructor. * * @param model list model */ - public LoadingList( ListModel model ) { + public LoadingList( ListModel model ) { super( model ); setCellRenderer( new LoadingRenderer() ); } @@ -50,7 +49,8 @@ private static class LoadingRenderer extends DefaultListCellRenderer { private Color fg_; private Font font_; - public Component getListCellRendererComponent( JList list, Object value, + public Component getListCellRendererComponent( JList list, + Object value, int index, boolean isSel, boolean hasFocus ) { Component comp = diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/MetaColumnModel.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/MetaColumnModel.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/MetaColumnModel.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/MetaColumnModel.java 2020-06-04 17:10:04.000000000 +0000 @@ -22,13 +22,12 @@ * or not shown (don't appear in this ColumnModel). * It does this by using an associated ListModel and ListSelectionModel. */ -@SuppressWarnings({"unchecked","rawtypes"}) public class MetaColumnModel extends DefaultTableColumnModel { - private DefaultListModel listModel; - private ListSelectionModel visibleModel; - private TableModel tableModel; - private BitSet purgedColumns = new BitSet(); + private final DefaultListModel listModel_; + private final ListSelectionModel visibleModel_; + private final TableModel tableModel_; + private final BitSet purgedColumns_; /** * Constructs a new MetaColumnModel from a base ColumnModel and a @@ -44,7 +43,8 @@ */ public MetaColumnModel( TableColumnModel baseColumnModel, TableModel tableModel ) { - this.tableModel = tableModel; + tableModel_ = tableModel; + purgedColumns_ = new BitSet(); /* Initialise state of this ColumnModel from the base column model. */ for ( int ipos = 0; ipos < baseColumnModel.getColumnCount(); ipos++ ) { @@ -57,23 +57,23 @@ /* Create and initialise a ListModel representing all the columns * in the original column model. */ - listModel = new DefaultListModel(); + listModel_ = new DefaultListModel(); for ( int ipos = 0; ipos < baseColumnModel.getColumnCount(); ipos++ ) { - listModel.addElement( baseColumnModel.getColumn( ipos ) ); + listModel_.addElement( baseColumnModel.getColumn( ipos ) ); } /* Create and initialise a ListSelectionModel representing * which columns appear in this ColumnModel. */ - visibleModel = new DefaultListSelectionModel(); - for ( int i = 0; i < listModel.getSize(); i++ ) { + visibleModel_ = new DefaultListSelectionModel(); + for ( int i = 0; i < listModel_.getSize(); i++ ) { if ( isVisible( i ) ) { - visibleModel.addSelectionInterval( i, i ); + visibleModel_.addSelectionInterval( i, i ); } } /* Make sure that this column model reflects any changes to the * visible model. */ - visibleModel.addListSelectionListener( new ListSelectionListener() { + visibleModel_.addListSelectionListener( new ListSelectionListener() { public void valueChanged( ListSelectionEvent evt ) { handleSelectionChange( evt ); } @@ -81,7 +81,7 @@ /* Make sure that if the table model changes so that something * interesting comes up, the relevant column is displayed. */ - tableModel.addTableModelListener( new TableModelListener() { + tableModel_.addTableModelListener( new TableModelListener() { public void tableChanged( TableModelEvent evt ) { handleTableChange( evt ); } @@ -90,13 +90,12 @@ /** * Returns the ListModel representing all the columns in the - * original TableColumnModel. Every entry in this ListModel will be - * a {@link javax.swing.table.TableColumn}. + * original TableColumnModel. * * @return the list model */ - public ListModel getListModel() { - return listModel; + public ListModel getListModel() { + return listModel_; } /** @@ -108,7 +107,7 @@ * @return the selection model */ public ListSelectionModel getVisibleModel() { - return visibleModel; + return visibleModel_; } /** @@ -123,7 +122,7 @@ /* Use DefaultTableColumnModel's protected tableColumns Vector to * answer the question. */ - return tableColumns.contains( listModel.get( i ) ); + return tableColumns.contains( listModel_.get( i ) ); } /** @@ -132,11 +131,11 @@ */ public void addColumn( TableColumn tcol ) { super.addColumn( tcol ); - if ( ! listModel.contains( tcol ) ) { - int insertPos = listModel.getSize(); - listModel.addElement( tcol ); - visibleModel.addSelectionInterval( insertPos, insertPos ); - purgedColumns.clear( insertPos ); + if ( ! listModel_.contains( tcol ) ) { + int insertPos = listModel_.getSize(); + listModel_.addElement( tcol ); + visibleModel_.addSelectionInterval( insertPos, insertPos ); + purgedColumns_.clear( insertPos ); } } @@ -146,10 +145,10 @@ */ public void removeColumn( TableColumn tcol ) { super.removeColumn( tcol ); - int ipos = listModel.indexOf( tcol ); + int ipos = listModel_.indexOf( tcol ); if ( ipos >= 0 ) { - visibleModel.removeSelectionInterval( ipos, ipos ); - purgedColumns.clear( ipos ); + visibleModel_.removeSelectionInterval( ipos, ipos ); + purgedColumns_.clear( ipos ); } } @@ -162,7 +161,7 @@ * @param ipos position of the column to remove */ public void removeColumn( int ipos ) { - removeColumn( (TableColumn) listModel.get( ipos ) ); + removeColumn( listModel_.get( ipos ) ); } /** @@ -173,20 +172,20 @@ * non-blank entry. */ public void purgeEmptyColumns() { - int nrow = tableModel.getRowCount(); - for ( int ipos = 0; ipos < listModel.getSize(); ipos++ ) { - TableColumn tcol = (TableColumn) listModel.get( ipos ); + int nrow = tableModel_.getRowCount(); + for ( int ipos = 0; ipos < listModel_.getSize(); ipos++ ) { + TableColumn tcol = listModel_.get( ipos ); int modelIndex = tcol.getModelIndex(); boolean stillBlank = true; for ( int irow = 0; irow < nrow && stillBlank; irow++ ) { - Object val = tableModel.getValueAt( irow, modelIndex ); + Object val = tableModel_.getValueAt( irow, modelIndex ); stillBlank = stillBlank && ( val == null || val.toString().trim().length() == 0 ); } if ( stillBlank ) { removeColumn( tcol ); - purgedColumns.set( ipos ); + purgedColumns_.set( ipos ); } } } @@ -200,12 +199,12 @@ */ public JMenu makeCheckBoxMenu( String name ) { CheckBoxMenu menu = new CheckBoxMenu( name ); - for ( int i = 0; i < listModel.getSize(); i++ ) { - TableColumn tcol = (TableColumn) listModel.getElementAt( i ); + for ( int i = 0; i < listModel_.getSize(); i++ ) { + TableColumn tcol = listModel_.getElementAt( i ); Object title = tcol.getHeaderValue(); menu.addMenuItem( title == null ? null : title.toString() ); } - menu.setSelectionModel( visibleModel ); + menu.setSelectionModel( visibleModel_ ); return menu; } @@ -226,28 +225,28 @@ /* If a column has turned invisible, remove it from this * column model. */ - if ( ! visibleModel.isSelectedIndex( i ) && + if ( ! visibleModel_.isSelectedIndex( i ) && isVisible( i ) ) { - TableColumn tcol = (TableColumn) listModel.get( i ); + TableColumn tcol = listModel_.get( i ); removeColumn( tcol ); } /* If a column has turned visible, add it to this * column model. */ - else if ( visibleModel.isSelectedIndex( i ) && ! isVisible( i ) ) { + else if ( visibleModel_.isSelectedIndex( i ) && ! isVisible( i ) ) { /* Add the column in question. */ - TableColumn tcol = (TableColumn) listModel.get( i ); + TableColumn tcol = listModel_.get( i ); addColumn( tcol ); /* Try to place it in the order of the original * column model, though if the columns have been * moved around by the user it might end up somewhere * funny. */ - int colPos = listModel.indexOf( tcol ); + int colPos = listModel_.indexOf( tcol ); int ipos = 0; while ( ipos < getColumnCount() && - listModel.indexOf( getColumn( ipos ) ) < colPos ) { + listModel_.indexOf( getColumn( ipos ) ) < colPos ) { ipos++; } int from = getColumnCount() - 1; @@ -268,19 +267,19 @@ if ( evt.getType() == TableModelEvent.DELETE ) { return; } - TableModel tableModel = (TableModel) evt.getSource(); + TableModel tableModel_ = (TableModel) evt.getSource(); int first = Math.max( evt.getFirstRow(), 0 ); - int last = Math.min( evt.getLastRow(), tableModel.getRowCount() - 1 ); - for ( int ipos = 0; ipos < listModel.size(); ipos++ ) { - if ( purgedColumns.get( ipos ) ) { + int last = Math.min( evt.getLastRow(), tableModel_.getRowCount() - 1 ); + for ( int ipos = 0; ipos < listModel_.size(); ipos++ ) { + if ( purgedColumns_.get( ipos ) ) { for ( int irow = first; irow <= last; irow++ ) { - TableColumn tcol = (TableColumn) listModel.get( ipos ); + TableColumn tcol = listModel_.get( ipos ); int modelIndex = tcol.getModelIndex(); - Object val = tableModel.getValueAt( irow, modelIndex ); + Object val = tableModel_.getValueAt( irow, modelIndex ); if ( ! isVisible( ipos ) && ( val != null && val.toString().trim().length() > 0 ) ) { - visibleModel.addSelectionInterval( ipos, ipos ); + visibleModel_.addSelectionInterval( ipos, ipos ); } } } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/MultiSubsetQueryWindow.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/MultiSubsetQueryWindow.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/MultiSubsetQueryWindow.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/MultiSubsetQueryWindow.java 2020-06-04 17:10:04.000000000 +0000 @@ -29,10 +29,9 @@ * @author Mark Taylor * @since 18 Sep 2018 */ -@SuppressWarnings("rawtypes") public class MultiSubsetQueryWindow extends QueryWindow { - private final JComboBox nameSelector_; + private final JComboBox nameSelector_; private final JTable jtable_; private final Entry[] entries_; private static final Color ENABLE_COLOR = @@ -148,15 +147,7 @@ */ private String getSubsetName() { Object nameObj = nameSelector_.getSelectedItem(); - if ( nameObj instanceof RowSubset ) { - return ((RowSubset) nameObj).getName(); - } - else if ( nameObj instanceof String ) { - return (String) nameObj; - } - else { - return null; - } + return nameObj == null ? null : nameObj.toString(); } protected boolean perform() { diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/OptionsListModel.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/OptionsListModel.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/OptionsListModel.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/OptionsListModel.java 2020-06-04 17:10:04.000000000 +0000 @@ -28,8 +28,8 @@ * * @author Mark Taylor (Starlink) */ -@SuppressWarnings({"unchecked","rawtypes"}) -public class OptionsListModel extends AbstractList implements ListModel { +public class OptionsListModel extends AbstractList + implements ListModel { private final List> entryList_; private final BasicListModel bmodel_; @@ -41,7 +41,9 @@ } public T get( int index ) { - return entryList_.get( index ).obj_; + return index >= 0 && index < entryList_.size() + ? entryList_.get( index ).obj_ + : null; } public T getElementAt( int index ) { @@ -114,9 +116,9 @@ * * @see #makeComboBox */ - public ComboBoxModel makeComboBoxModel() { - class ListComboBoxModel extends BasicListModel - implements ComboBoxModel, ListDataListener { + public ComboBoxModel makeComboBoxModel() { + class ListComboBoxModel extends BasicListModel + implements ComboBoxModel, ListDataListener { private Object selected_; public void setSelectedItem( Object item ) { if ( ( selected_ != null && ! selected_.equals( item ) ) || @@ -148,13 +150,15 @@ * Makes a new JComboBox from this model. This adds to the functionality * of {@link #makeComboBoxModel} by ensuring that the box is * revalidated when new items are added to the model; otherwise the - * box can end up too small. It also ensures that the box is - * rendered by using the name of the RowSubset is written. + * box can end up too small. + * + *

      Note however that no renderer is installed, so custom + * rendering must be as required handled by client code. * * @return a combo box from which items in this model can be selected */ - public JComboBox makeComboBox() { - final JComboBox box = new JComboBox( makeComboBoxModel() ); + public JComboBox makeComboBox() { + final JComboBox box = new JComboBox( makeComboBoxModel() ); addListDataListener( new ListDataListener() { public void intervalAdded( ListDataEvent evt ) { box.revalidate(); @@ -162,13 +166,6 @@ public void intervalRemoved( ListDataEvent evt ) {} public void contentsChanged( ListDataEvent evt ) {} } ); - box.setRenderer( - new CustomComboBoxRenderer( RowSubset.class ) { - @Override - protected String mapValue( RowSubset rset ) { - return rset.getName(); - } - } ); return box; } @@ -287,8 +284,8 @@ /** * ListModel adapter. */ - private class BasicListModel extends AbstractListModel { - public Object getElementAt( int index ) { + private class BasicListModel extends AbstractListModel { + public T getElementAt( int index ) { return get( index ); } public int getSize() { diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ParameterQueryWindow.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ParameterQueryWindow.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/ParameterQueryWindow.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/ParameterQueryWindow.java 2020-06-04 17:10:04.000000000 +0000 @@ -16,12 +16,11 @@ * @author Mark Taylor (Starlink) * @since 17 Aug 2004 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class ParameterQueryWindow extends QueryWindow { private final TopcatModel tcModel_; private final JTextField nameField_; - private final JComboBox typeBox_; + private final JComboBox> typeBox_; private final JTextField valueField_; private final JTextField unitsField_; private final JTextField descField_; @@ -44,7 +43,7 @@ stack.addLine( "Parameter Name", nameField_ ); /* Type field. */ - typeBox_ = new JComboBox(); + typeBox_ = new JComboBox>(); typeBox_.addItem( String.class ); typeBox_.addItem( Byte.class ); typeBox_.addItem( Short.class ); diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot/AxisDataSelector.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot/AxisDataSelector.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot/AxisDataSelector.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot/AxisDataSelector.java 2020-06-04 17:10:04.000000000 +0000 @@ -17,6 +17,7 @@ import uk.ac.starlink.table.ColumnData; import uk.ac.starlink.table.ColumnInfo; import uk.ac.starlink.topcat.ActionForwarder; +import uk.ac.starlink.topcat.ColumnDataComboBox; import uk.ac.starlink.topcat.ColumnDataComboBoxModel; import uk.ac.starlink.topcat.ToggleButtonModel; import uk.ac.starlink.topcat.TopcatModel; @@ -96,10 +97,10 @@ /* Construct all the column selectors which may be needed * (though possibly some will never be used). */ - atSelector_ = ColumnDataComboBoxModel.createComboBox(); - loSelector_ = ColumnDataComboBoxModel.createComboBox(); - hiSelector_ = ColumnDataComboBoxModel.createComboBox(); - lhSelector_ = ColumnDataComboBoxModel.createComboBox(); + atSelector_ = new ColumnDataComboBox(); + loSelector_ = new ColumnDataComboBox(); + hiSelector_ = new ColumnDataComboBox(); + lhSelector_ = new ColumnDataComboBox(); JComboBox[] selectors = getSelectors(); assert selectors.length == 4; for ( int i = 0; i < selectors.length; i++ ) { diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot/DensityStyleEditor.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot/DensityStyleEditor.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot/DensityStyleEditor.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot/DensityStyleEditor.java 2020-06-04 17:10:04.000000000 +0000 @@ -20,7 +20,7 @@ */ public class DensityStyleEditor extends StyleEditor { - final RenderingComboBox styleSelector_; + final RenderingComboBox styleSelector_; /** * Constructor. @@ -35,9 +35,9 @@ final ToggleButtonModel rgbModel ) { Box colorBox = Box.createHorizontalBox(); - styleSelector_ = new RenderingComboBox( styles ) { - protected Icon getRendererIcon( Object item ) { - return ((Style) item).getLegendIcon(); + styleSelector_ = new RenderingComboBox( styles ) { + protected Icon getRendererIcon( DensityStyle style ) { + return style.getLegendIcon(); }; }; styleSelector_.addActionListener( this ); diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot/LabelledAxesSelector.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot/LabelledAxesSelector.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot/LabelledAxesSelector.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot/LabelledAxesSelector.java 2020-06-04 17:10:04.000000000 +0000 @@ -7,6 +7,7 @@ import javax.swing.JLabel; import uk.ac.starlink.table.ColumnData; import uk.ac.starlink.table.StarTable; +import uk.ac.starlink.topcat.ColumnDataComboBox; import uk.ac.starlink.topcat.ColumnDataComboBoxModel; import uk.ac.starlink.topcat.TopcatModel; import uk.ac.starlink.ttools.plot.ErrorMode; @@ -39,7 +40,7 @@ */ public LabelledAxesSelector( AxesSelector baseSelector ) { baseSelector_ = baseSelector; - labelSelector_ = ColumnDataComboBoxModel.createComboBox(); + labelSelector_ = new ColumnDataComboBox(); selectorPanel_ = Box.createVerticalBox(); selectorPanel_.add( baseSelector.getColumnSelectorPanel() ); labelContainer_ = Box.createVerticalBox(); diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot2/AreaCoordPanel.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot2/AreaCoordPanel.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot2/AreaCoordPanel.java 1970-01-01 00:00:00.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot2/AreaCoordPanel.java 2020-06-04 17:10:04.000000000 +0000 @@ -0,0 +1,102 @@ +package uk.ac.starlink.topcat.plot2; + +import uk.ac.starlink.table.ColumnData; +import uk.ac.starlink.table.ColumnInfo; +import uk.ac.starlink.table.Tables; +import uk.ac.starlink.topcat.ColumnDataComboBoxModel; +import uk.ac.starlink.ttools.plot2.PlotUtil; +import uk.ac.starlink.ttools.plot2.config.ConfigKey; +import uk.ac.starlink.ttools.plot2.data.AreaCoord; +import uk.ac.starlink.ttools.plot2.data.Coord; + +/** + * PositionCoordPanel for entering positional Area values. + * This implementation class mostly handles autopopulation + * (default values). + * + * @author Mark Taylor + * @since 27 Mar 2020 + */ +public abstract class AreaCoordPanel extends PositionCoordPanel { + + /** + * Constructor. + * + * @param coord coordinate for Area objects + * @param otherCoords additional coordinates required by panel + * @param configKeys config value keys (often empty) + */ + protected AreaCoordPanel( AreaCoord coord, Coord[] otherCoords, + ConfigKey[] configKeys ) { + super( PlotUtil.arrayConcat( new Coord[] { coord }, otherCoords ), + configKeys ); + } + + @Override + public void autoPopulate() { + ColumnDataComboBoxModel areaSelector = getColumnSelector( 0, 0 ); + if ( areaSelector == null ) { + assert false; + return; + } + int ncol = areaSelector.getSize(); + int bestScore = 0; + ColumnData bestCdata = null; + for ( int ic = 0; ic < ncol; ic++ ) { + ColumnData cdata = areaSelector.getColumnDataAt( ic ); + if ( cdata != null ) { + ColumnInfo info = cdata.getColumnInfo(); + if ( info != null ) { + int score = getAreaScore( info ); + if ( score > bestScore ) { + bestScore = score; + bestCdata = cdata; + } + } + } + } + if ( bestCdata != null ) { + areaSelector.setSelectedItem( bestCdata ); + } + } + + /** + * Returns some kind of value which indicates how likely a column + * is to represent an area that can be plotted by this panel. + * + * @param info column metadata + * @return score for area compability: + * higher is better, zero means no use + */ + private static int getAreaScore( ColumnInfo info ) { + int score = 0; + Class clazz = info.getContentClass(); + String name = info.getName(); + String ucd = info.getUCD(); + String xtype = Tables.getXtype( info ); + boolean isString = clazz.equals( String.class ); + boolean isNumarray = clazz.equals( float[].class ) + || clazz.equals( double[].class ); + if ( isString || isNumarray ) { + if ( "s_region".equals( name ) ) { + score += 4; + } + if ( "pos.outline;obs.field".equals( ucd ) ) { + score += 3; + } + else if ( ucd != null && ucd.startsWith( "pos.outline" ) ) { + score += 2; + } + } + if ( isNumarray ) { + if ( "circle".equalsIgnoreCase( xtype ) || + "polygon".equalsIgnoreCase( xtype ) ) { + score += 5; + } + else if ( "point".equalsIgnoreCase( xtype ) ) { + score += 2; + } + } + return score; + } +} diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot2/BasicCoordLayerControl.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot2/BasicCoordLayerControl.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot2/BasicCoordLayerControl.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot2/BasicCoordLayerControl.java 2020-06-04 17:10:04.000000000 +0000 @@ -13,12 +13,12 @@ import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JLabel; +import javax.swing.ListModel; import uk.ac.starlink.topcat.AlignedBox; import uk.ac.starlink.topcat.LineBox; import uk.ac.starlink.topcat.RowSubset; import uk.ac.starlink.topcat.TablesListComboBox; import uk.ac.starlink.topcat.TopcatModel; -import uk.ac.starlink.topcat.TypedListModel; import uk.ac.starlink.ttools.plot2.DataGeom; import uk.ac.starlink.ttools.plot2.LegendEntry; import uk.ac.starlink.ttools.plot2.PlotLayer; @@ -36,7 +36,6 @@ * @author Mark Taylor * @since 25 Nov 2013 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class BasicCoordLayerControl extends ConfigControl implements LayerControl { @@ -45,8 +44,8 @@ private final PositionCoordPanel coordPanel_; private final Configger baseConfigger_; private final boolean autoPopulate_; - private final JComboBox subsetSelector_; - private final ComboBoxModel dummyComboBoxModel_; + private final JComboBox subsetSelector_; + private final ComboBoxModel dummyComboBoxModel_; private final ConfigStyler styler_; private final Specifier zsel_; private TopcatModel tcModel_; @@ -66,7 +65,7 @@ */ public BasicCoordLayerControl( Plotter plotter, Specifier zsel, PositionCoordPanel coordPanel, - TypedListModel tablesModel, + ListModel tablesModel, Configger baseConfigger, boolean autoPopulate ) { super( null, plotter.getPlotterIcon() ); @@ -79,7 +78,7 @@ /* Create data selection components. */ tableSelector_ = new TablesListComboBox( tablesModel, 250 ); - subsetSelector_ = new JComboBox(); + subsetSelector_ = new JComboBox(); dummyComboBoxModel_ = subsetSelector_.getModel(); /* Ensure listeners are notified. */ @@ -135,7 +134,8 @@ } public TopcatLayer[] getLayers() { - RowSubset subset = (RowSubset) subsetSelector_.getSelectedItem(); + RowSubset subset = + subsetSelector_.getItemAt( subsetSelector_.getSelectedIndex() ); GuiCoordContent[] coordContents = coordPanel_.getContents(); if ( tcModel_ == null || coordContents == null || subset == null ) { return new TopcatLayer[ 0 ]; @@ -224,7 +224,7 @@ coordPanel_.setTable( tcModel, autoPopulate_ ); /* Set up subset selector. */ - final ComboBoxModel subselModel; + final ComboBoxModel subselModel; if ( tcModel == null ) { subselModel = dummyComboBoxModel_; } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot2/ControlStack.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot2/ControlStack.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot2/ControlStack.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot2/ControlStack.java 2020-06-04 17:10:04.000000000 +0000 @@ -40,7 +40,7 @@ * @param stackModel stack model */ public ControlStack( ControlStackModel stackModel ) { - super( Control.class, stackModel, true, new JLabel() ); + super( stackModel, true, new JLabel() ); stackModel_ = stackModel; } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot2/ControlStackModel.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot2/ControlStackModel.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot2/ControlStackModel.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot2/ControlStackModel.java 2020-06-04 17:10:04.000000000 +0000 @@ -20,8 +20,7 @@ * @author Mark Taylor * @since 13 Mar 2013 */ -@SuppressWarnings({"unchecked","rawtypes"}) -public class ControlStackModel extends AbstractListModel { +public class ControlStackModel extends AbstractListModel { private final List list_; private final Map activeMap_; @@ -56,7 +55,7 @@ } ); } - public Object getElementAt( int ix ) { + public Control getElementAt( int ix ) { return getControlAt( ix ); } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot2/ControlStackPanel.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot2/ControlStackPanel.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot2/ControlStackPanel.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot2/ControlStackPanel.java 2020-06-04 17:10:04.000000000 +0000 @@ -33,10 +33,9 @@ * @author Mark Taylor * @since 13 Mar 2013 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class ControlStackPanel extends JPanel { - private final DefaultListModel fixListModel_; + private final DefaultListModel fixListModel_; /** * Constructor. @@ -50,13 +49,14 @@ detailHolder.setMinimumSize( new Dimension( 200, 100 ) ); /* Set up a list for the fixed controls. */ - fixListModel_ = new DefaultListModel(); - JList fixList = new JList( fixListModel_ ); + fixListModel_ = new DefaultListModel<>(); + JList fixList = new JList( fixListModel_ ); fixList.setCellRenderer( new FixRenderer() ); /* Set up an object which keeps track of when a control has been * newly added to the stack. */ - Spotter controlSpotter = new Spotter( stack.getStackModel() ); + Spotter controlSpotter = + new Spotter( stack.getStackModel() ); stack.getStackModel().addListDataListener( controlSpotter ); /* Set up selection listeners. Only one item from either list @@ -138,8 +138,8 @@ * Selection listener for changes to the selected control. */ private static class ControlListener implements ListSelectionListener { - private final JList list1_; - private final JList list2_; + private final JList list1_; + private final JList list2_; private final JComponent controlHolder_; /** @@ -154,7 +154,8 @@ * on selection this will be populated with * the content panel for the selected control */ - ControlListener( JList list1, JList list2, JComponent controlHolder ) { + ControlListener( JList list1, JList list2, + JComponent controlHolder ) { list1_ = list1; list2_ = list2; controlHolder_ = controlHolder; @@ -162,7 +163,7 @@ public void valueChanged( ListSelectionEvent evt ) { if ( ! evt.getValueIsAdjusting() ) { - Control control = (Control) list1_.getSelectedValue(); + Control control = list1_.getSelectedValue(); if ( control != null ) { list2_.clearSelection(); adjustControl( control ); @@ -194,7 +195,7 @@ */ private static class LayerControlListener extends ControlListener { - final Spotter spotter_; + final Spotter spotter_; Control lastControl_; /** @@ -206,8 +207,8 @@ * @param spotter object that keeps track of when a control has * been just added */ - LayerControlListener( JList list1, JList list2, JComponent holder, - Spotter spotter ) { + LayerControlListener( JList list1, JList list2, + JComponent holder, Spotter spotter ) { super( list1, list2, holder ); spotter_ = spotter; } @@ -226,18 +227,18 @@ /** * Listener that keeps track of when a control is first added to the stack. */ - private static class Spotter implements ListDataListener { - private final ListModel model_; - private final Map items_; + private static class Spotter implements ListDataListener { + private final ListModel model_; + private final Map items_; /** * Constructor. * * @param model stack model */ - Spotter( ListModel model ) { + Spotter( ListModel model ) { model_ = model; - items_ = new HashMap(); + items_ = new HashMap(); update(); } @@ -249,7 +250,7 @@ * @return true iff this method has never been called * on item before */ - public boolean isNew( Object item ) { + public boolean isNew( T item ) { Boolean isNew = items_.get( item ); if ( Boolean.FALSE.equals( isNew ) ) { return false; @@ -262,7 +263,7 @@ } private void update() { - Set itemSet = new HashSet(); + Set itemSet = new HashSet(); for ( int i = 0; i < model_.getSize(); i++ ) { itemSet.add( model_.getElementAt( i ) ); } @@ -272,7 +273,7 @@ /* Work out which ones we haven't seen before. */ itemSet.removeAll( items_.keySet() ); - for ( Object item : itemSet ) { + for ( T item : itemSet ) { items_.put( item, Boolean.TRUE ); } } @@ -292,7 +293,8 @@ * List cell renderer for the fixed control items. */ private static class FixRenderer extends DefaultListCellRenderer { - public Component getListCellRendererComponent( JList list, Object value, + public Component getListCellRendererComponent( JList list, + Object value, int index, boolean isSel, boolean hasFocus ) { super.getListCellRendererComponent( list, value, index, isSel, diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot2/CoordPanel.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot2/CoordPanel.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot2/CoordPanel.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot2/CoordPanel.java 2020-06-04 17:10:04.000000000 +0000 @@ -16,10 +16,14 @@ import uk.ac.starlink.table.ColumnData; import uk.ac.starlink.table.ColumnInfo; import uk.ac.starlink.table.ConstantColumn; +import uk.ac.starlink.table.Domain; +import uk.ac.starlink.table.DomainMapper; import uk.ac.starlink.table.ValueInfo; import uk.ac.starlink.table.gui.LabelledComponentStack; import uk.ac.starlink.topcat.ActionForwarder; +import uk.ac.starlink.topcat.ColumnDataComboBox; import uk.ac.starlink.topcat.ColumnDataComboBoxModel; +import uk.ac.starlink.topcat.DomainMapperComboBox; import uk.ac.starlink.topcat.LineBox; import uk.ac.starlink.topcat.TopcatModel; import uk.ac.starlink.ttools.plot2.PlotUtil; @@ -29,6 +33,7 @@ import uk.ac.starlink.ttools.plot2.data.Input; import uk.ac.starlink.ttools.plot2.data.InputMeta; import uk.ac.starlink.util.gui.ComboBoxBumper; +import uk.ac.starlink.util.gui.ShrinkWrapper; /** * GUI component for entry of Coord values as table column expressions. @@ -36,13 +41,12 @@ * @author Mark Taylor * @since 13 Mar 2013 */ -@SuppressWarnings({"unchecked","rawtypes"}) public class CoordPanel { private final Coord[] coords_; private final ConfigSpecifier cspec_; private final ActionForwarder forwarder_; - private final JComboBox[][] colSelectors_; + private final List> colSelectors_; private final JComponent panel_; private TopcatModel tcModel_; @@ -76,21 +80,28 @@ /* Place entry components for each required coordinate. */ int nc = coords.length; - colSelectors_ = new JComboBox[ nc ][]; + colSelectors_ = new ArrayList>(); LabelledComponentStack stack = new LabelledComponentStack(); for ( int ic = 0; ic < nc; ic++ ) { Input[] inputs = coords[ ic ].getInputs(); int ni = inputs.length; - colSelectors_[ ic ] = new JComboBox[ ni ]; + colSelectors_.add( new ArrayList() ); for ( int ii = 0; ii < ni; ii++ ) { InputMeta meta = inputs[ ii ].getMeta(); - final JComboBox cs = ColumnDataComboBoxModel.createComboBox(); - colSelectors_[ ic ][ ii ] = cs; + Domain domain = inputs[ ii ].getDomain(); + final ColumnDataComboBox cs = new ColumnDataComboBox( domain ); + colSelectors_.get( ic ).add( cs ); cs.addActionListener( forwarder_ ); JComponent line = Box.createHorizontalBox(); line.add( cs ); line.add( Box.createHorizontalStrut( 5 ) ); line.add( new ComboBoxBumper( cs ) ); + DomainMapperComboBox dmSelector = cs.getDomainMapperSelector(); + if ( dmSelector != null ) { + dmSelector.addActionListener( forwarder_ ); + line.add( Box.createHorizontalStrut( 10 ) ); + line.add( dmSelector.getComponent() ); + } /* Set the width to a small value, but add it to the stack * with xfill true. This has the effect of making it @@ -220,17 +231,17 @@ int ninRequired = 0; int ninPopulated = 0; for ( int ic = 0; ic < coords_.length; ic++ ) { - JComboBox[] colsels = colSelectors_[ ic ]; + List colsels = colSelectors_.get( ic ); Coord coord = coords_[ ic ]; boolean isReq = coord.isRequired(); Input[] inputs = coord.getInputs(); - int ni = colsels.length; + int ni = colsels.size(); if ( isReq ) { ninRequired += ni; } for ( int ii = 0; ii < ni; ii++ ) { InputMeta meta = inputs[ ii ].getMeta(); - JComboBox cs = colsels[ ii ]; + JComboBox cs = colsels.get( ii ); Object sel0 = cs.getSelectedItem(); String str0 = sel0 instanceof ColumnData ? sel0.toString() @@ -240,10 +251,16 @@ cs.setEnabled( false ); } else { + final Domain domain = inputs[ ii ].getDomain(); + ColumnDataComboBoxModel.Filter filter = + new ColumnDataComboBoxModel.Filter() { + public boolean acceptColumn( ValueInfo info ) { + return domain.getPossibleMapper( info ) != null; + } + }; ColumnDataComboBoxModel model = - new ColumnDataComboBoxModel( tcModel, - inputs[ ii ] - .getValueClass(), true ); + new ColumnDataComboBoxModel( tcModel, filter, true, + false ); cs.setModel( model ); cs.setEnabled( true ); @@ -286,9 +303,7 @@ int is = 1; for ( int ic = 0; ic < coords_.length; ic++ ) { if ( coords_[ ic ].isRequired() ) { - JComboBox[] colsels = colSelectors_[ ic ]; - for ( int iu = 0; iu < colsels.length; iu++ ) { - JComboBox cs = colsels[ iu ]; + for ( JComboBox cs : colSelectors_.get( ic ) ) { if ( is < cs.getItemCount() ) { cs.setSelectedIndex( is++ ); } @@ -321,30 +336,36 @@ GuiCoordContent[] contents = new GuiCoordContent[ npc ]; for ( int ic = 0; ic < npc; ic++ ) { Coord coord = coords_[ ic ]; - JComboBox[] colsels = colSelectors_[ ic ]; - int nu = colsels.length; + List colsels = colSelectors_.get( ic ); + int nu = colsels.size(); ColumnData[] coldats = new ColumnData[ nu ]; String[] datlabs = new String[ nu ]; + DomainMapper[] dms = new DomainMapper[ nu ]; for ( int iu = 0; iu < nu; iu++ ) { - Object colitem = colsels[ iu ].getSelectedItem(); + ColumnDataComboBox colsel = colsels.get( iu ); + Object colitem = colsel.getSelectedItem(); + DomainMapper dm = colsel.getDomainMapper(); if ( colitem instanceof ColumnData ) { coldats[ iu ] = (ColumnData) colitem; datlabs[ iu ] = colitem.toString(); + dms[ iu ] = dm; } else if ( ! coord.isRequired() ) { Input input = coord.getInputs()[ iu ]; ColumnInfo info = new ColumnInfo( input.getMeta().getLongName(), - input.getValueClass(), + dm.getSourceClass(), input.getMeta().getShortDescription() ); coldats[ iu ] = new ConstantColumn( info, null ); datlabs[ iu ] = null; + dms[ iu ] = dm; } else { return null; } } - contents[ ic ] = new GuiCoordContent( coord, datlabs, coldats ); + contents[ ic ] = + new GuiCoordContent( coord, datlabs, coldats, dms ); } return contents; } @@ -358,7 +379,8 @@ * @return selector model, or null */ public ColumnDataComboBoxModel getColumnSelector( int ic, int iu ) { - ComboBoxModel model = colSelectors_[ ic ][ iu ].getModel(); + ComboBoxModel model = + colSelectors_.get( ic ).get( iu ).getModel(); return model instanceof ColumnDataComboBoxModel ? (ColumnDataComboBoxModel) model : null; @@ -373,7 +395,7 @@ */ public void setColumnSelector( int ic, int iu, ColumnDataComboBoxModel model ) { - colSelectors_[ ic ][ iu ].setModel( model ); + colSelectors_.get( ic ).get( iu ).setModel( model ); } /** diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot2/CubePlotWindow.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot2/CubePlotWindow.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot2/CubePlotWindow.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot2/CubePlotWindow.java 2020-06-04 17:10:04.000000000 +0000 @@ -2,8 +2,8 @@ import java.awt.Component; import java.awt.Rectangle; +import javax.swing.ListModel; import uk.ac.starlink.topcat.TopcatModel; -import uk.ac.starlink.topcat.TypedListModel; import uk.ac.starlink.ttools.plot2.GangerFactory; import uk.ac.starlink.ttools.plot2.SingleGanger; import uk.ac.starlink.ttools.plot2.Surface; @@ -38,7 +38,7 @@ * @param tablesModel list of available tables */ public CubePlotWindow( Component parent, - TypedListModel tablesModel ) { + ListModel tablesModel ) { super( "Cube Plot", parent, PLOT_TYPE, PLOT_GUI, tablesModel ); getToolBar().addSeparator(); addHelp( "CubePlotWindow" ); @@ -58,6 +58,9 @@ .createPanel( PLOT_TYPE.getPointDataGeoms()[ 0 ], npos, XYZ_SPOTTERS ); } + public PositionCoordPanel createAreaCoordPanel() { + throw new UnsupportedOperationException(); + } public boolean hasPositions() { return true; } diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot2/FigurePanel.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot2/FigurePanel.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot2/FigurePanel.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot2/FigurePanel.java 2020-06-04 17:10:04.000000000 +0000 @@ -434,18 +434,17 @@ * and provides a selector which the user can use to choose * which FigureMode will be used. */ - @SuppressWarnings({"unchecked","rawtypes"}) private class ModeEnquiryPanel extends JPanel { - private final JComboBox modeSelector_; + private final JComboBox modeSelector_; /** * Constructor. */ ModeEnquiryPanel() { setLayout( new BoxLayout( this, BoxLayout.Y_AXIS ) ); - modeSelector_ = new JComboBox( figureModes_ ); + modeSelector_ = new JComboBox( figureModes_ ); modeSelector_.setRenderer( - new CustomComboBoxRenderer( FigureMode.class ) { + new CustomComboBoxRenderer() { @Override protected String mapValue( FigureMode figmode ) { return figmode.getName(); @@ -471,7 +470,7 @@ * @return selected mode (not null) */ public FigureMode getSelectedMode() { - return (FigureMode) modeSelector_.getSelectedItem(); + return modeSelector_.getItemAt( modeSelector_.getSelectedIndex() ); } /** diff -Nru starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot2/FormLayerControl.java starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot2/FormLayerControl.java --- starjava-topcat-4.7/src/main/uk/ac/starlink/topcat/plot2/FormLayerControl.java 2019-11-18 16:53:42.000000000 +0000 +++ starjava-topcat-4.7.1/src/main/uk/ac/starlink/topcat/plot2/FormLayerControl.java 2020-06-04 17:10:04.000000000 +0000 @@ -37,7 +37,6 @@ import uk.ac.starlink.topcat.TopcatEvent; import uk.ac.starlink.topcat.TopcatListener; import uk.ac.starlink.topcat.TopcatModel; -import uk.ac.starlink.topcat.TypedListModel; /** * Plot layer control which manages coordinates and subsets in a common way @@ -55,7 +54,7 @@ private final PositionCoordPanel posCoordPanel_; private final boolean autoPopulate_; private final TablesListComboBox tableSelector_; - private final WrapperListModel subListModel_; + private final WrapperListModel subListModel_; private final SubsetConfigManager subsetManager_; private final TopcatListener tcListener_; private final SubsetStack subStack_; @@ -79,7 +78,7 @@ * @param controlIcon icon for control stack */ protected FormLayerControl( PositionCoordPanel posCoordPanel, - TypedListModel tablesModel, + ListModel tablesModel, Specifier zsel, boolean autoPopulate, NextSupplier nextSupplier, TopcatListener tcListener, Icon controlIcon ) { @@ -125,7 +124,7 @@ * the table changes, other components in this control can just * listen for changes to the wrapper model, they don't have to be * messaged explicitly when the underlying model changes. */ - subListModel_ = new WrapperListModel(); + subListModel_ = new WrapperListModel(); subStack_ = new SubsetStack( subListModel_, subsetManager_ ); subStack_.addActionListener( forwarder ); @@ -366,20 +365,16 @@ */ private static Map> getStylesBySubset( TopcatLayer[] tcLayers ) { - Map> map = - new LinkedHashMap>(); + Map> map = new LinkedHashMap<>(); for ( TopcatLayer tcLayer : tcLayers ) { PlotLayer layer = tcLayer.getPlotLayer(); DataSpec dspec = layer.getDataSpec(); if ( dspec != null ) { - Object mask = dspec.getMaskId(); - assert mask instanceof RowSubset; - if ( mask instanceof RowSubset ) { - RowSubset rset = (RowSubset) mask; - if ( ! map.containsKey( rset ) ) { - map.put( rset, new ArrayList