From 912204639150d59d91ab0066ff275d8ea5f01e1c Mon Sep 17 00:00:00 2001 From: Yana Stamcheva Date: Mon, 30 May 2011 11:39:32 +0000 Subject: [PATCH] Shows resolution information in the new resize video button menu. --- .../impl/gui/main/call/ResizeVideoButton.java | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/net/java/sip/communicator/impl/gui/main/call/ResizeVideoButton.java b/src/net/java/sip/communicator/impl/gui/main/call/ResizeVideoButton.java index db47f7fce..4cd7aafed 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/ResizeVideoButton.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/ResizeVideoButton.java @@ -93,28 +93,26 @@ private JPopupMenu createResizeVideoMenu() popupMenu.setInvoker(this); popupMenu.setFocusable(true); + Dimension loDimension = QualityPreset.LO_QUALITY.getResolution(); + Dimension sdDimension = QualityPreset.SD_QUALITY.getResolution(); + Dimension hdDimension = QualityPreset.HD_QUALITY.getResolution(); + JMenuItem lowQuality = new JMenuItem( GuiActivator.getResources() .getI18NString("service.gui.LOW_QUALITY") - + " (" - + (int) QualityPreset.LO_QUALITY.getResolution().getHeight() - + "p)", + + getFormattedDimension(loDimension), GuiActivator.getResources() .getImage("service.gui.icons.LO_VIDEO_ICON")); JMenuItem normalQuality = new JMenuItem(GuiActivator.getResources() .getI18NString("service.gui.SD_QUALITY") - + " (" - + (int) QualityPreset.SD_QUALITY.getResolution().getHeight() - + "p)", + + getFormattedDimension(sdDimension), GuiActivator.getResources() .getImage("service.gui.icons.SD_VIDEO_ICON")); JMenuItem hdQuality = new JMenuItem(GuiActivator.getResources() .getI18NString("service.gui.HD_QUALITY") - + " (" - + (int) QualityPreset.HD_QUALITY.getResolution().getHeight() - + "p)", + + getFormattedDimension(hdDimension), GuiActivator.getResources() .getImage("service.gui.icons.HD_VIDEO_ICON")); @@ -172,4 +170,15 @@ public void actionPerformed(ActionEvent e) return popupMenu; } + + /** + * Returns a formatted string representing the given dimension. + * + * @param d the dimension to represent in the string + * @return the formatted dimension string + */ + private String getFormattedDimension(Dimension d) + { + return " (" + (int) d.getWidth() + "x" + (int) d.getHeight() + ")"; + } }