Hi, about half of the calls to ImageLibrary methods were already to static methods, but did often go through pains getting access to an object reference and yes, often there are 2 or 4 methods with same name where half is static and half not. I changed it to make that a bit more obvious, the other reason was to quickly reduce the amount of reference passing, but kept all behaviour of the code the same as it had been already. Instead of renaming all those ImageLibrary methods, I wanted to comb through them to first reduce all those calls duplicated for ImageIcon and Image (possibly introducing a simple helper to universally access this conversion to icons with and without scaling factor), split ImageLibrary into a class containing the static utility parts and another with scaling. Later, I thought of looking into enabling scaling for fonts (splitting all font stuff from ImageLibrary and GUI in a separate class and replacing the constants with 2 enums and methods) and into sorting out scaling the ImageIcons (and Images) and finding where that would make sense and where not (there some object references may need to be reintroduced, but that should be the easy part).
Oh yes, BR#2726 is what is providing my motivation behind this. My fear is though, that after all that preparatory work our dependence on putting absolute pixel values into MigLayout and other GUI elements in so many places, will be stalling the effort. Regards wintertime > Gesendet: Donnerstag, 12. März 2015 um 09:32 Uhr > Von: "Michael T. Pope" <mp...@computer.org> > An: win...@genial.ms > Betreff: image library changes > > Are you sure about some of the recent ImageLibrary changes which used > to call through an ImageLibrary object but are now static > (git.6c1ced2)? For example the following: > > diff --git a/src/net/sf/freecol/client/gui/panel/EndTurnDialog.java > b/src/net/sf/freecol/client/gui/panel/EndTurnDialog.java > index d130321..ad7ebf8 100644 > --- a/src/net/sf/freecol/client/gui/panel/EndTurnDialog.java > +++ b/src/net/sf/freecol/client/gui/panel/EndTurnDialog.java > @@ -116,7 +117,7 @@ public final class EndTurnDialog extends > FreeColConfirmDialog { > int index, > boolean isSelected, > boolean cellHasFocus) { > - > imageLabel.setIcon(getImageLibrary().getUnitImageIcon(value.unit, 0.5)); > + imageLabel.setIcon(ImageLibrary.getUnitImageIcon(value.unit, > 0.5)); > nameLabel.setText(value.name); > locationLabel.setText(value.location); > > > I am concerned that this may mean that the ImageLibrary.scalingFactor > is no longer applied. I admit not looking hard at the code in detail, > but given BR#2726, I thought we needed to be sure scaling was > pervasive? > > Clearly there are places where we want not to scale. Would it make > sense to make such calls obvious by renaming the relevant calls to > something like get<graphicsThing>Unscaled(...)? > > Cheers, > Mike Pope > ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Freecol-developers mailing list Freecol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freecol-developers