Hi, Here after is the change I have committed today : the tooltip is now supposed to display "Feature count = #" ( as you suggested) when the layer has no description or an empty description or a description equals to the name otherwise, the tool tip displays "name: description" as before
Let me know if the change is ok for your application Michaël String tooltip = ""; if (layerable instanceof Layer) { if (((Layer) layerable).getDescription() == null || ((Layer) layerable).getDescription().trim().length() == 0 || ((Layer) layerable).getDescription().equals(layerable.getName())) { tooltip = FEATURE_COUNT + " = " + ((Layer) layerable).getFeatureCollectionWrapper().size(); } else {tooltip = layerable.getName() + ": " + ((Layer) layerable).getDescription(); } } else tooltip = layerable.getName(); Kevin Neufeld a écrit : > Hi Michaël, > > Having a feature count readily available is a nice addition for a quick > overview in the Jump environment, either as a > tooltip or displayed in the status bar. > > If you prefer it as a layer tooltip, may I suggest you drop the layer name > (since that's redundant information) and > prefix the [#objects] with a description. Honestly, it took me a while to > clue in to what the [#] was actually > indicating as I was panning around and the number kept changing. Perhaps > something like: > > Feature Count: [#objects] > > But, I do agree that this should only be used if there is no layer > description. That way, ppl can override it if they > want. If that works in the LayerNameRenderer class, that's great. > > Thanx for your efforts Michaël, it's appreciated. > > Cheers, > Kevin > > > Michael Michaud wrote: > >> Hi Kevin (and others for advice) >> >> Sorry for the annoyance, I realize that the ToolTipText content is >> defined in the LayerNameRenderer class, and that I overrode the previous >> behaviour, adding a method directly in the TreeLayerNamePanel. >> I added the number of objects in the tooltip because I found it useful >> to have a quick access to this information, but we have also this >> information in the layer property (right click), so that it is not >> absolutely necessary to have it in the tooltip >> >> By the way, I can move my code into LayerNameRenderer and add the number >> (#objects) of objects only if there is no description, or in both cases, >> or never : >> >> * layer name (never or only when there is no description = previous >> behaviour) >> * layer name [#objects] (only if there is no description or in both >> cases = actual behaviour) >> * layer name: description (never or only if there is no description = >> overriden behaviour) >> * layer name: description [#objects] (in both cases = possible bbehaviour) >> >> Just let me know your thought about your preferences >> >> Michaël >> >> Kevin Neufeld a écrit : >> >>> On Aug10, michaudm committed a tooltip addition to the >>> com\vividsolutions\jump\workbench\ui\TreeLayerNamePanel.java file >>> (revision 1531 "Display the number of features after the layer name in >>> the layer name tooltip"). >>> >>> It used to be that the Tooltip for a layer was derived by overriding >>> com.vividsolutions.jump.workbench.model.Layer#getDescription(). >>> >>> This no longer works. >>> >>> I have a couple of custom Layers that retrieve features from a PostGIS >>> database dynamically. The tooltip on these layers is used to display >>> the current SQL query used in this DataStore, but this change in >>> revision 1531 overrides that. >>> >>> Can someone please commit the attached patch, or alternatively, find a >>> way to display michaudm's change to all Layers that don't return >>> something useful when overriding >>> com.vividsolutions.jump.workbench.model.Layer#getDescription(). >>> >>> Cheers, >>> Kevin >>> >>> >>> ------------------------------------------------------------------------ >>> >>> ------------------------------------------------------------------------- >>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >>> Build the coolest Linux based applications with Moblin SDK & win great >>> prizes >>> Grand prize is a trip for two to an Open Source event anywhere in the world >>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Jump-pilot-devel mailing list >>> Jump-pilot-devel@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel >>> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >> Build the coolest Linux based applications with Moblin SDK & win great prizes >> Grand prize is a trip for two to an Open Source event anywhere in the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Jump-pilot-devel mailing list >> Jump-pilot-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel >> > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > > > ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel