options.useLocalCursor.setSelected(viewer.useLocalCursor.getValue());
options.acceptBell.setSelected(viewer.acceptBell.getValue());
String scaleString = viewer.scalingFactor.getValue();
- if (scaleString.equals("Auto")) {
+ if (scaleString.equalsIgnoreCase("Auto")) {
options.scalingFactor.setSelectedItem("Auto");
- } else if(scaleString.equals("FixedRatio")) {
+ } else if(scaleString.equalsIgnoreCase("FixedRatio")) {
options.scalingFactor.setSelectedItem("Fixed Aspect Ratio");
} else {
digit = Integer.parseInt(scaleString);
String scaleString =
options.scalingFactor.getSelectedItem().toString();
String oldScaleFactor = viewer.scalingFactor.getValue();
- if (scaleString.equals("Auto")) {
+ if (scaleString.equalsIgnoreCase("Auto")) {
if (!oldScaleFactor.equals(scaleString)) {
viewer.scalingFactor.setParam("Auto");
if (desktop != null)
reconfigureViewport();
}
- } else if(scaleString.equals("Fixed Aspect Ratio")) {
- if (!oldScaleFactor.equals("FixedRatio")) {
+ } else if(scaleString.equalsIgnoreCase("Fixed Aspect Ratio")) {
+ if (!oldScaleFactor.equalsIgnoreCase("FixedRatio")) {
viewer.scalingFactor.setParam("FixedRatio");
if (desktop != null)
reconfigureViewport();
scaleString=scaleString.substring(0, scaleString.length()-1);
if (!oldScaleFactor.equals(scaleString)) {
viewer.scalingFactor.setParam(scaleString);
- if ((desktop != null) && (!oldScaleFactor.equals("Auto") ||
- !oldScaleFactor.equals("FixedRatio"))) {
+ if ((desktop != null) && (!oldScaleFactor.equalsIgnoreCase("Auto") ||
+ !oldScaleFactor.equalsIgnoreCase("FixedRatio"))) {
reconfigureViewport();
}
}
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
* Copyright (C) 2006 Constantin Kaplinsky. All Rights Reserved.
* Copyright (C) 2009 Paul Donohue. All Rights Reserved.
- * Copyright (C) 2010 D. R. Commander. All Rights Reserved.
+ * Copyright (C) 2010, 2012 D. R. Commander. All Rights Reserved.
* Copyright (C) 2011-2012 Brian P. Hinz
*
* This is free software; you can redistribute it and/or modify
public void setScaledSize() {
String scaleString = cc.viewer.scalingFactor.getValue();
- if (!scaleString.equals("Auto") && !scaleString.equals("FixedRatio")) {
+ if (!scaleString.equalsIgnoreCase("Auto") &&
+ !scaleString.equalsIgnoreCase("FixedRatio")) {
int scalingFactor = Integer.parseInt(scaleString);
scaledWidth =
(int)Math.floor((float)cc.cp.width * (float)scalingFactor/100.0);
vpSize.height - vpInsets.top - vpInsets.bottom);
if (availableSize.width == 0 || availableSize.height == 0)
availableSize = new Dimension(cc.cp.width, cc.cp.height);
- if (scaleString.equals("FixedRatio")) {
+ if (scaleString.equalsIgnoreCase("FixedRatio")) {
float widthRatio = (float)availableSize.width / (float)cc.cp.width;
float heightRatio = (float)availableSize.height / (float)cc.cp.height;
float ratio = Math.min(widthRatio, heightRatio);
cc.toggleFullScreen();
}
String scaleString = cc.viewer.scalingFactor.getValue();
- if (scaleString.equals("Auto") || scaleString.equals("FixedRatio")) {
+ if (scaleString.equalsIgnoreCase("Auto") ||
+ scaleString.equalsIgnoreCase("FixedRatio")) {
if ((sp.getSize().width != cc.desktop.scaledWidth) ||
(sp.getSize().height != cc.desktop.scaledHeight)) {
int policy = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER;
cc.desktop.scaledHeight));
sp.validate();
if (getExtendedState() != JFrame.MAXIMIZED_BOTH &&
- scaleString.equals("FixedRatio")) {
+ scaleString.equalsIgnoreCase("FixedRatio")) {
int w = cc.desktop.scaledWidth + getInsets().left + getInsets().right;
int h = cc.desktop.scaledHeight + getInsets().top + getInsets().bottom;
setSize(w, h);