X-Git-Url: https://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Fgui%2FDetailsDisplay.java;h=ec68e162633dc66472138c20d6c1ac3a602c7303;hb=649c5da6ee1bbc590699e11a92316ece2ea8512d;hp=c40f8c2b4891360144bfe60d55dfd4817fd9a456;hpb=112bb0c9b46894adca9a33ed8c99ea712b253185;p=GpsPrune.git diff --git a/tim/prune/gui/DetailsDisplay.java b/tim/prune/gui/DetailsDisplay.java index c40f8c2..ec68e16 100644 --- a/tim/prune/gui/DetailsDisplay.java +++ b/tim/prune/gui/DetailsDisplay.java @@ -3,7 +3,9 @@ package tim.prune.gui; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; +import java.awt.FlowLayout; import java.awt.Font; +import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.text.NumberFormat; @@ -11,18 +13,25 @@ import java.text.NumberFormat; import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; +import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.JPanel; +import javax.swing.JProgressBar; import javax.swing.border.EtchedBorder; -import tim.prune.Config; import tim.prune.DataSubscriber; +import tim.prune.FunctionLibrary; +import tim.prune.GenericFunction; import tim.prune.I18nManager; +import tim.prune.UpdateMessageBroker; +import tim.prune.config.Config; import tim.prune.data.Altitude; +import tim.prune.data.AudioClip; import tim.prune.data.Coordinate; import tim.prune.data.DataPoint; import tim.prune.data.Distance; +import tim.prune.data.Field; import tim.prune.data.IntegerRange; import tim.prune.data.Photo; import tim.prune.data.Selection; @@ -37,22 +46,34 @@ public class DetailsDisplay extends GenericDisplay // Point details private JLabel _indexLabel = null; private JLabel _latLabel = null, _longLabel = null; - private JLabel _altLabel = null, _nameLabel = null; + private JLabel _altLabel = null; private JLabel _timeLabel = null, _speedLabel = null; + private JLabel _nameLabel = null, _typeLabel = null; // Range details private JLabel _rangeLabel = null; - private JLabel _distanceLabel = null, _movingDistanceLabel = null; + private JLabel _distanceLabel = null; private JLabel _durationLabel = null; private JLabel _altRangeLabel = null, _updownLabel = null; - private JLabel _aveSpeedLabel = null, _aveMovingSpeedLabel = null; - private JLabel _paceLabel = null; + private JLabel _aveSpeedLabel = null; // Photo details + private JPanel _photoDetailsPanel = null; private JLabel _photoLabel = null; private PhotoThumbnail _photoThumbnail = null; private JLabel _photoTimestampLabel = null; private JLabel _photoConnectedLabel = null; + private JLabel _photoBearingLabel = null; + private JPanel _rotationButtons = null; + + // Audio details + private JPanel _audioDetailsPanel = null; + private JLabel _audioLabel = null; + private JLabel _audioConnectedLabel = null; + private JLabel _audioTimestampLabel = null; + private JLabel _audioLengthLabel = null; + private JProgressBar _audioProgress = null; + private JPanel _playAudioPanel = null; // Units private JComboBox _coordFormatDropdown = null; @@ -67,13 +88,14 @@ public class DetailsDisplay extends GenericDisplay private static final String LABEL_POINT_ALTITUDE = I18nManager.getText("fieldname.altitude") + ": "; private static final String LABEL_POINT_TIMESTAMP = I18nManager.getText("fieldname.timestamp") + ": "; private static final String LABEL_POINT_WAYPOINTNAME = I18nManager.getText("fieldname.waypointname") + ": "; + private static final String LABEL_POINT_WAYPOINTTYPE = I18nManager.getText("fieldname.waypointtype") + ": "; private static final String LABEL_RANGE_SELECTED = I18nManager.getText("details.range.selected") + ": "; private static final String LABEL_RANGE_DURATION = I18nManager.getText("fieldname.duration") + ": "; private static final String LABEL_RANGE_DISTANCE = I18nManager.getText("fieldname.distance") + ": "; - private static final String LABEL_RANGE_MOVINGDISTANCE = I18nManager.getText("fieldname.movingdistance") + ": "; private static final String LABEL_RANGE_ALTITUDE = I18nManager.getText("fieldname.altitude") + ": "; private static final String LABEL_RANGE_CLIMB = I18nManager.getText("details.range.climb") + ": "; private static final String LABEL_RANGE_DESCENT = ", " + I18nManager.getText("details.range.descent") + ": "; + private static final String LABEL_AUDIO_FILE = I18nManager.getText("details.audio.file") + ": "; private static String LABEL_POINT_ALTITUDE_UNITS = null; private static Altitude.Format LABEL_POINT_ALTITUDE_FORMAT = Altitude.Format.NO_FORMAT; @@ -90,18 +112,11 @@ public class DetailsDisplay extends GenericDisplay JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); mainPanel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); + Font biggerFont = new JLabel().getFont(); + biggerFont = biggerFont.deriveFont(Font.BOLD, biggerFont.getSize2D() + 2.0f); // Point details panel - JPanel pointDetailsPanel = new JPanel(); - pointDetailsPanel.setLayout(new BoxLayout(pointDetailsPanel, BoxLayout.Y_AXIS)); - pointDetailsPanel.setBorder(BorderFactory.createCompoundBorder( - BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), BorderFactory.createEmptyBorder(3, 3, 3, 3)) - ); - JLabel pointDetailsLabel = new JLabel(I18nManager.getText("details.pointdetails")); - Font biggerFont = pointDetailsLabel.getFont(); - biggerFont = biggerFont.deriveFont(Font.BOLD, biggerFont.getSize2D() + 2.0f); - pointDetailsLabel.setFont(biggerFont); - pointDetailsPanel.add(pointDetailsLabel); + JPanel pointDetailsPanel = makeDetailsPanel("details.pointdetails", biggerFont); _indexLabel = new JLabel(I18nManager.getText("details.nopointselection")); pointDetailsPanel.add(_indexLabel); _latLabel = new JLabel(""); @@ -111,36 +126,26 @@ public class DetailsDisplay extends GenericDisplay _altLabel = new JLabel(""); pointDetailsPanel.add(_altLabel); _timeLabel = new JLabel(""); + _timeLabel.setMinimumSize(new Dimension(120, 10)); pointDetailsPanel.add(_timeLabel); _speedLabel = new JLabel(""); pointDetailsPanel.add(_speedLabel); _nameLabel = new JLabel(""); pointDetailsPanel.add(_nameLabel); + _typeLabel = new JLabel(""); + pointDetailsPanel.add(_typeLabel); pointDetailsPanel.setAlignmentX(Component.LEFT_ALIGNMENT); // range details panel - JPanel rangeDetailsPanel = new JPanel(); - rangeDetailsPanel.setLayout(new BoxLayout(rangeDetailsPanel, BoxLayout.Y_AXIS)); - rangeDetailsPanel.setBorder(BorderFactory.createCompoundBorder( - BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), BorderFactory.createEmptyBorder(3, 3, 3, 3)) - ); - JLabel rangeDetailsLabel = new JLabel(I18nManager.getText("details.rangedetails")); - rangeDetailsLabel.setFont(biggerFont); - rangeDetailsPanel.add(rangeDetailsLabel); + JPanel rangeDetailsPanel = makeDetailsPanel("details.rangedetails", biggerFont); _rangeLabel = new JLabel(I18nManager.getText("details.norangeselection")); rangeDetailsPanel.add(_rangeLabel); _distanceLabel = new JLabel(""); rangeDetailsPanel.add(_distanceLabel); - _movingDistanceLabel = new JLabel(""); - rangeDetailsPanel.add(_movingDistanceLabel); _durationLabel = new JLabel(""); rangeDetailsPanel.add(_durationLabel); _aveSpeedLabel = new JLabel(""); rangeDetailsPanel.add(_aveSpeedLabel); - _aveMovingSpeedLabel = new JLabel(""); - rangeDetailsPanel.add(_aveMovingSpeedLabel); - _paceLabel = new JLabel(""); - rangeDetailsPanel.add(_paceLabel); _altRangeLabel = new JLabel(""); rangeDetailsPanel.add(_altRangeLabel); _updownLabel = new JLabel(""); @@ -148,31 +153,70 @@ public class DetailsDisplay extends GenericDisplay rangeDetailsPanel.setAlignmentX(Component.LEFT_ALIGNMENT); // photo details panel - JPanel photoDetailsPanel = new JPanel(); - photoDetailsPanel.setLayout(new BoxLayout(photoDetailsPanel, BoxLayout.Y_AXIS)); - photoDetailsPanel.setBorder(BorderFactory.createCompoundBorder( - BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), BorderFactory.createEmptyBorder(3, 3, 3, 3)) - ); - JLabel photoDetailsLabel = new JLabel(I18nManager.getText("details.photodetails")); - photoDetailsLabel.setFont(biggerFont); - photoDetailsPanel.add(photoDetailsLabel); + _photoDetailsPanel = makeDetailsPanel("details.photodetails", biggerFont); _photoLabel = new JLabel(I18nManager.getText("details.nophoto")); - photoDetailsPanel.add(_photoLabel); + _photoDetailsPanel.add(_photoLabel); _photoTimestampLabel = new JLabel(""); - photoDetailsPanel.add(_photoTimestampLabel); + _photoTimestampLabel.setMinimumSize(new Dimension(120, 10)); + _photoDetailsPanel.add(_photoTimestampLabel); _photoConnectedLabel = new JLabel(""); - photoDetailsPanel.add(_photoConnectedLabel); + _photoDetailsPanel.add(_photoConnectedLabel); + _photoBearingLabel = new JLabel(""); + _photoDetailsPanel.add(_photoBearingLabel); _photoThumbnail = new PhotoThumbnail(); _photoThumbnail.setVisible(false); _photoThumbnail.setPreferredSize(new Dimension(100, 100)); - photoDetailsPanel.add(_photoThumbnail); + _photoDetailsPanel.add(_photoThumbnail); + // Rotate buttons + JButton rotLeft = makeRotateButton(IconManager.ROTATE_LEFT, FunctionLibrary.FUNCTION_ROTATE_PHOTO_LEFT); + JButton rotRight = makeRotateButton(IconManager.ROTATE_RIGHT, FunctionLibrary.FUNCTION_ROTATE_PHOTO_RIGHT); + JButton popup = makeRotateButton(IconManager.SHOW_DETAILS, FunctionLibrary.FUNCTION_PHOTO_POPUP); + _rotationButtons = new JPanel(); + _rotationButtons.add(rotLeft); + _rotationButtons.add(rotRight); + _rotationButtons.add(Box.createHorizontalStrut(10)); + _rotationButtons.add(popup); + _rotationButtons.setAlignmentX(Component.LEFT_ALIGNMENT); + _rotationButtons.setVisible(false); + _photoDetailsPanel.add(_rotationButtons); + _photoDetailsPanel.setVisible(false); + + // audio details panel + _audioDetailsPanel = makeDetailsPanel("details.audiodetails", biggerFont); + _audioLabel = new JLabel(I18nManager.getText("details.noaudio")); + _audioDetailsPanel.add(_audioLabel); + _audioTimestampLabel = new JLabel(""); + _audioTimestampLabel.setMinimumSize(new Dimension(120, 10)); + _audioDetailsPanel.add(_audioTimestampLabel); + _audioLengthLabel = new JLabel(""); + _audioDetailsPanel.add(_audioLengthLabel); + _audioConnectedLabel = new JLabel(""); + _audioDetailsPanel.add(_audioConnectedLabel); + _audioProgress = new JProgressBar(0, 100); + _audioProgress.setString(I18nManager.getText("details.audio.playing")); + _audioProgress.setStringPainted(true); + _audioProgress.setVisible(false); + _audioDetailsPanel.add(_audioProgress); + _playAudioPanel = new JPanel(); + _playAudioPanel.setLayout(new FlowLayout(FlowLayout.RIGHT)); + JButton playAudio = makeRotateButton(IconManager.PLAY_AUDIO, FunctionLibrary.FUNCTION_PLAY_AUDIO); + playAudio.addActionListener(new AudioListener(_audioProgress)); + _playAudioPanel.add(playAudio); + JButton stopAudio = makeRotateButton(IconManager.STOP_AUDIO, FunctionLibrary.FUNCTION_STOP_AUDIO); + _playAudioPanel.add(stopAudio); + _playAudioPanel.setAlignmentX(Component.LEFT_ALIGNMENT); + _playAudioPanel.setVisible(false); + _audioDetailsPanel.add(_playAudioPanel); + _audioDetailsPanel.setVisible(false); // add the details panels to the main panel mainPanel.add(pointDetailsPanel); mainPanel.add(Box.createVerticalStrut(5)); mainPanel.add(rangeDetailsPanel); mainPanel.add(Box.createVerticalStrut(5)); - mainPanel.add(photoDetailsPanel); + mainPanel.add(_photoDetailsPanel); + mainPanel.add(Box.createVerticalStrut(5)); + mainPanel.add(_audioDetailsPanel); mainPanel.add(Box.createVerticalStrut(5)); // add the main panel at the top add(mainPanel, BorderLayout.NORTH); @@ -203,8 +247,8 @@ public class DetailsDisplay extends GenericDisplay _distUnitsDropdown.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - dataUpdated(DataSubscriber.UNITS_CHANGED); Config.setConfigBoolean(Config.KEY_METRIC_UNITS, _distUnitsDropdown.getSelectedIndex() == 0); + UpdateMessageBroker.informSubscribers(DataSubscriber.UNITS_CHANGED); } }); lowerPanel.add(_distUnitsDropdown); @@ -222,6 +266,7 @@ public class DetailsDisplay extends GenericDisplay // Update current point data, if any DataPoint currentPoint = _trackInfo.getCurrentPoint(); Selection selection = _trackInfo.getSelection(); + if ((inUpdateType | DATA_ADDED_OR_REMOVED) > 0) selection.markInvalid(); int currentPointIndex = selection.getCurrentPointIndex(); _speedLabel.setText(""); Distance.Units distUnits = _distUnitsDropdown.getSelectedIndex()==0?Distance.Units.KILOMETRES:Distance.Units.MILES; @@ -235,6 +280,7 @@ public class DetailsDisplay extends GenericDisplay _altLabel.setText(""); _timeLabel.setText(""); _nameLabel.setText(""); + _typeLabel.setText(""); } else { @@ -271,12 +317,19 @@ public class DetailsDisplay extends GenericDisplay else { _timeLabel.setText(""); } - String name = currentPoint.getWaypointName(); + // Waypoint name + final String name = currentPoint.getWaypointName(); if (name != null && !name.equals("")) { _nameLabel.setText(LABEL_POINT_WAYPOINTNAME + name); } else _nameLabel.setText(""); + // Waypoint type + final String type = currentPoint.getFieldValue(Field.WAYPT_TYPE); + if (type != null && !type.equals("")) { + _typeLabel.setText(LABEL_POINT_WAYPOINTTYPE + type); + } + else _typeLabel.setText(""); } // Update range details @@ -284,13 +337,10 @@ public class DetailsDisplay extends GenericDisplay { _rangeLabel.setText(I18nManager.getText("details.norangeselection")); _distanceLabel.setText(""); - _movingDistanceLabel.setText(""); _durationLabel.setText(""); _altRangeLabel.setText(""); _updownLabel.setText(""); _aveSpeedLabel.setText(""); - _aveMovingSpeedLabel.setText(""); - _paceLabel.setText(""); } else { @@ -298,38 +348,15 @@ public class DetailsDisplay extends GenericDisplay + (selection.getStart()+1) + " " + I18nManager.getText("details.range.to") + " " + (selection.getEnd()+1)); _distanceLabel.setText(LABEL_RANGE_DISTANCE + roundedNumber(selection.getDistance(distUnits)) + " " + distUnitsStr); - if (selection.getHasMultipleSegments()) { - _movingDistanceLabel.setText(LABEL_RANGE_MOVINGDISTANCE + roundedNumber(selection.getMovingDistance(distUnits)) + " " + distUnitsStr); - } - else { - _movingDistanceLabel.setText(null); - } if (selection.getNumSeconds() > 0) { - _durationLabel.setText(LABEL_RANGE_DURATION + buildDurationString(selection.getNumSeconds())); + _durationLabel.setText(LABEL_RANGE_DURATION + DisplayUtils.buildDurationString(selection.getNumSeconds())); _aveSpeedLabel.setText(I18nManager.getText("details.range.avespeed") + ": " + roundedNumber(selection.getDistance(distUnits)/selection.getNumSeconds()*3600.0) + " " + speedUnitsStr); - if (selection.getHasMultipleSegments()) { - _aveMovingSpeedLabel.setText(I18nManager.getText("details.range.avemovingspeed") + ": " - + roundedNumber(selection.getMovingDistance(distUnits)/selection.getMovingSeconds()*3600.0) + " " + speedUnitsStr); - } - else { - _aveMovingSpeedLabel.setText(null); - } - if (Config.getConfigBoolean(Config.KEY_SHOW_PACE)) { - _paceLabel.setText(I18nManager.getText("details.range.pace") + ": " - + buildDurationString((long) (selection.getNumSeconds()/selection.getDistance(distUnits))) - + " / " + distUnitsStr); - } - else { - _paceLabel.setText(""); - } } else { _durationLabel.setText(""); _aveSpeedLabel.setText(""); - _aveMovingSpeedLabel.setText(""); - _paceLabel.setText(""); } String altUnitsLabel = getAltitudeUnitsLabel(selection.getAltitudeFormat()); IntegerRange altRange = selection.getAltitudeRange(); @@ -349,6 +376,7 @@ public class DetailsDisplay extends GenericDisplay } } // show photo details and thumbnail + _photoDetailsPanel.setVisible(_trackInfo.getPhotoList().getNumPhotos() > 0); Photo currentPhoto = _trackInfo.getPhotoList().getPhoto(_trackInfo.getSelection().getCurrentPhotoIndex()); if ((currentPoint == null || currentPoint.getPhoto() == null) && currentPhoto == null) { @@ -356,20 +384,51 @@ public class DetailsDisplay extends GenericDisplay _photoLabel.setText(I18nManager.getText("details.nophoto")); _photoTimestampLabel.setText(""); _photoConnectedLabel.setText(""); + _photoBearingLabel.setText(""); _photoThumbnail.setVisible(false); + _rotationButtons.setVisible(false); } else { if (currentPhoto == null) {currentPhoto = currentPoint.getPhoto();} - _photoLabel.setText(I18nManager.getText("details.photofile") + ": " + currentPhoto.getFile().getName()); - _photoTimestampLabel.setText(LABEL_POINT_TIMESTAMP + currentPhoto.getTimestamp().getText()); - _photoConnectedLabel.setText(I18nManager.getText("details.photo.connected") + ": " + _photoLabel.setText(I18nManager.getText("details.photofile") + ": " + currentPhoto.getName()); + _photoTimestampLabel.setText(currentPhoto.hasTimestamp()?(LABEL_POINT_TIMESTAMP + currentPhoto.getTimestamp().getText()):""); + _photoConnectedLabel.setText(I18nManager.getText("details.media.connected") + ": " + (currentPhoto.getCurrentStatus() == Photo.Status.NOT_CONNECTED ? I18nManager.getText("dialog.about.no"):I18nManager.getText("dialog.about.yes"))); + if (currentPhoto.getBearing() >= 0.0 && currentPhoto.getBearing() <= 360.0) + { + _photoBearingLabel.setText(I18nManager.getText("details.photo.bearing") + ": " + + (int) currentPhoto.getBearing() + " \u00B0"); + } + else _photoBearingLabel.setText(""); _photoThumbnail.setVisible(true); _photoThumbnail.setPhoto(currentPhoto); + _rotationButtons.setVisible(true); + if ((inUpdateType & DataSubscriber.PHOTOS_MODIFIED) > 0) {_photoThumbnail.refresh();} } _photoThumbnail.repaint(); + + // audio details + _audioDetailsPanel.setVisible(_trackInfo.getAudioList().getNumAudios() > 0); + AudioClip currentAudio = _trackInfo.getAudioList().getAudio(_trackInfo.getSelection().getCurrentAudioIndex()); + if (currentAudio == null) { + _audioLabel.setText(I18nManager.getText("details.noaudio")); + _audioTimestampLabel.setText(""); + _audioLengthLabel.setText(""); + _audioConnectedLabel.setText(""); + } + else + { + _audioLabel.setText(LABEL_AUDIO_FILE + currentAudio.getName()); + _audioTimestampLabel.setText(currentAudio.hasTimestamp()?(LABEL_POINT_TIMESTAMP + currentAudio.getTimestamp().getText()):""); + int audioLength = currentAudio.getLengthInSeconds(); + _audioLengthLabel.setText(audioLength < 0?"":LABEL_RANGE_DURATION + DisplayUtils.buildDurationString(audioLength)); + _audioConnectedLabel.setText(I18nManager.getText("details.media.connected") + ": " + + (currentAudio.getCurrentStatus() == Photo.Status.NOT_CONNECTED ? + I18nManager.getText("dialog.about.no"):I18nManager.getText("dialog.about.yes"))); + } + _playAudioPanel.setVisible(currentAudio != null); } @@ -409,27 +468,12 @@ public class DetailsDisplay extends GenericDisplay default: // just as it was coord = inCoordinate.output(Coordinate.FORMAT_NONE); } - return inPrefix + coord; - } - - - /** - * Build a String to describe a time duration - * @param inNumSecs number of seconds - * @return time as a string, days, hours, mins, secs as appropriate - */ - private static String buildDurationString(long inNumSecs) - { - if (inNumSecs <= 0L) return ""; - if (inNumSecs < 60L) return "" + inNumSecs + I18nManager.getText("display.range.time.secs"); - if (inNumSecs < 3600L) return "" + (inNumSecs / 60) + I18nManager.getText("display.range.time.mins") - + " " + (inNumSecs % 60) + I18nManager.getText("display.range.time.secs"); - if (inNumSecs < 86400L) return "" + (inNumSecs / 60 / 60) + I18nManager.getText("display.range.time.hours") - + " " + ((inNumSecs / 60) % 60) + I18nManager.getText("display.range.time.mins"); - if (inNumSecs < 432000L) return "" + (inNumSecs / 86400L) + I18nManager.getText("display.range.time.days") - + " " + (inNumSecs / 60 / 60) % 24 + I18nManager.getText("display.range.time.hours"); - if (inNumSecs < 8640000L) return "" + (inNumSecs / 86400L) + I18nManager.getText("display.range.time.days"); - return "big"; + // Fix broken degree signs (due to unicode mangling) + final char brokenDeg = 65533; + if (coord.indexOf(brokenDeg) >= 0) { + coord = coord.replaceAll(String.valueOf(brokenDeg), "\u00B0"); + } + return inPrefix + restrictDP(coord); } @@ -453,4 +497,57 @@ public class DetailsDisplay extends GenericDisplay _distanceFormatter.setMinimumFractionDigits(numDigits); return _distanceFormatter.format(inDist); } + + /** + * Restrict the given coordinate to a limited number of decimal places for display + * @param inCoord coordinate string + * @return chopped string + */ + private static String restrictDP(String inCoord) + { + final int DECIMAL_PLACES = 7; + if (inCoord == null) return ""; + final int dotPos = Math.max(inCoord.lastIndexOf('.'), inCoord.lastIndexOf(',')); + if (dotPos >= 0) { + final int chopPos = dotPos + DECIMAL_PLACES; + if (chopPos < (inCoord.length()-1)) { + return inCoord.substring(0, chopPos); + } + } + return inCoord; + } + + /** + * Make a details subpanel + * @param inNameKey key to use for top label + * @param inFont font for top label + * @return panel with correct layout, label + */ + private static JPanel makeDetailsPanel(String inNameKey, Font inFont) + { + JPanel detailsPanel = new JPanel(); + detailsPanel.setLayout(new BoxLayout(detailsPanel, BoxLayout.Y_AXIS)); + detailsPanel.setBorder(BorderFactory.createCompoundBorder( + BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), BorderFactory.createEmptyBorder(3, 3, 3, 3)) + ); + JLabel detailsLabel = new JLabel(I18nManager.getText(inNameKey)); + detailsLabel.setFont(inFont); + detailsPanel.add(detailsLabel); + return detailsPanel; + } + + /** + * Create a little button for rotating the current photo + * @param inIcon icon to use (from IconManager) + * @param inFunction function to call (from FunctionLibrary) + * @return button object + */ + private static JButton makeRotateButton(String inIcon, GenericFunction inFunction) + { + JButton button = new JButton(IconManager.getImageIcon(inIcon)); + button.setToolTipText(I18nManager.getText(inFunction.getNameKey())); + button.setMargin(new Insets(0, 2, 0, 2)); + button.addActionListener(new FunctionLauncher(inFunction)); + return button; + } }