Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ifs #112

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions src/com/zebraimaging/ZebraInputHandler.java
Original file line number Diff line number Diff line change
@@ -19,28 +19,28 @@ public class ZebraInputHandler extends AWTInputHandler
/** All instantiations of this class are stored for internal retrieval. */
private static List<ZebraInputHandler> instances = new ArrayList<ZebraInputHandler>();
private static Timer repaintContextsTimer = null;

final static TimerTask repaintContextsTask = new TimerTask()
{
public void run()
public void run()
{
Iterator<ZebraInputHandler> itr = instances.iterator();
while (itr.hasNext())
{
ZebraInputHandler h = itr.next();
ZebraInputHandler h = itr.next();
if (h.NeedsRefresh() == true)
{
h.SetRefresh(false);
h.getWorldWindow().redraw();
}
}
}
}
};

private long hwnd = 0;
private boolean arGL2Present = false;
private boolean arGL2Present = false;
private boolean refresh = false;

public ZebraInputHandler()
{
/**
@@ -49,7 +49,7 @@ public ZebraInputHandler()
* (b) Not using the Zebra integration tools.
*/
try
{
{
System.loadLibrary("arGL2Integrator");
arGL2Present = true;
instances.add(this);
@@ -59,7 +59,7 @@ public ZebraInputHandler()
{
System.out.println("FAILED to load arGL2Integrator.dll");
}

if (repaintContextsTimer == null)
{
repaintContextsTimer = new Timer();
@@ -68,21 +68,21 @@ public ZebraInputHandler()
}

private synchronized void SetRefresh(boolean value)
{
{
refresh = value;
}

private synchronized boolean NeedsRefresh()
{
return refresh;
}

public void keyPressed(KeyEvent e)
{
boolean consumed = false;
if (arGL2Present)
consumed = zebraKeyPressed(getGLCanvasHandle(), e.getKeyCode());
if (consumed == true)
if (consumed)
e.consume();
else
super.keyPressed(e);
@@ -93,7 +93,7 @@ public void keyReleased(KeyEvent e)
boolean consumed = false;
if (arGL2Present)
consumed = zebraKeyReleased(getGLCanvasHandle(), e.getKeyCode());
if (consumed == true)
if (consumed)
e.consume();
else
super.keyReleased(e);
@@ -104,7 +104,7 @@ public void mouseClicked(MouseEvent e)
boolean consumed = false;
if (arGL2Present)
consumed = zebraMouseReleased(getGLCanvasHandle(), e.getButton(), e.getX(), e.getY());
if (consumed == true)
if (consumed)
e.consume();
else
super.mouseClicked(e);
@@ -115,7 +115,7 @@ public void mousePressed(MouseEvent e)
boolean consumed = false;
if (arGL2Present)
consumed = zebraMousePressed(getGLCanvasHandle(), e.getButton(), e.getX(), e.getY());
if (consumed == true)
if (consumed)
e.consume();
else
super.mousePressed(e);
@@ -126,7 +126,7 @@ public void mouseReleased(MouseEvent e)
boolean consumed = false;
if (arGL2Present)
consumed = zebraMouseReleased(getGLCanvasHandle(), e.getButton(), e.getX(), e.getY());
if (consumed == true)
if (consumed)
e.consume();
else
super.mouseReleased(e);
@@ -143,7 +143,7 @@ public void mouseDragged(MouseEvent e)
boolean consumed = false;
if (arGL2Present)
consumed = zebraMouseMoved(getGLCanvasHandle(), button, e.getX(), e.getY());
if (consumed == true)
if (consumed)
e.consume();
else
super.mouseDragged(e);
@@ -154,7 +154,7 @@ public void mouseWheelMoved(MouseWheelEvent e)
boolean consumed = false;
if (arGL2Present)
consumed = zebraMouseWheel(getGLCanvasHandle(), e.getWheelRotation());
if (consumed == true)
if (consumed)
e.consume();
else
super.mouseWheelMoved(e);
@@ -198,7 +198,7 @@ private static ZebraInputHandler getInstance(long hwnd)
// Java static methods executed by arGL2Integrator.dll via JNI

public static void forceRepaint(long hwnd)
{
{
/** Force the instance of the ZebraViewInputHandler class to redraw it's associated OpenGL window. */
ZebraInputHandler h = getInstance(hwnd);
if (h != null)
2 changes: 1 addition & 1 deletion src/gov/nasa/worldwind/Restorable.java
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ public interface Restorable
/**
* Returns an XML document string describing the object's state. This state can be restored later by calling
* <code>restoreState</code> and passing the XML document.
*
*
* @return an XML document string describing the object's state.
*/
String getRestorableState();
4 changes: 1 addition & 3 deletions src/gov/nasa/worldwind/animation/AngleAnimator.java
Original file line number Diff line number Diff line change
@@ -112,7 +112,7 @@ public Angle getEnd()

/**
* Get the {@link gov.nasa.worldwind.util.PropertyAccessor} in use by this animation
*
*
* @return the {@link gov.nasa.worldwind.util.PropertyAccessor} in use by this animation
*/
public PropertyAccessor.AngleAccessor getPropertyAccessor()
@@ -150,7 +150,5 @@ private Angle nextAngle(double interpolant)
interpolant,
this.begin,
this.end);


}
}
2 changes: 1 addition & 1 deletion src/gov/nasa/worldwind/animation/AnimationController.java
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ public boolean stepAnimators()

/**
* Returns <code>true</code> if the controller has any active <code>Animations</code>
*
*
* @return true if there are any active animations in this <code>CompountAnimation</code>
*/
public boolean hasActiveAnimation()
2 changes: 1 addition & 1 deletion src/gov/nasa/worldwind/animation/BasicAnimator.java
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ public class BasicAnimator implements Animator

/**
* Constructs a <code>BasicAnimator</code>. Sets the <code>Animator</code>'s <code>Interpolator</code> to
* <code>null</code>.
* <code>null</code>.
*/
public BasicAnimator()
{
4 changes: 2 additions & 2 deletions src/gov/nasa/worldwind/animation/DoubleAnimator.java
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ public DoubleAnimator(Interpolator interpolator,
{
this.interpolator = new ScheduledInterpolator(10000);
}

if (propertyAccessor == null)
{
String message = Logging.getMessage("nullValue.ViewPropertyAccessorIsNull");
@@ -90,5 +90,5 @@ public Double nextDouble(double interpolant)
this.end);
}


}
4 changes: 2 additions & 2 deletions src/gov/nasa/worldwind/animation/PositionAnimator.java
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
*/
public class PositionAnimator extends BasicAnimator
{

protected Position begin;
protected Position end;
protected final PropertyAccessor.PositionAccessor propertyAccessor;
@@ -47,7 +47,7 @@ public PositionAnimator(
this.end = end;
this.propertyAccessor = propertyAccessor;
}

public void setBegin(Position begin)
{
this.begin = begin;
2 changes: 1 addition & 1 deletion src/gov/nasa/worldwind/animation/SmoothInterpolator.java
Original file line number Diff line number Diff line change
@@ -42,5 +42,5 @@ protected static double basicInterpolant(double interpolant, double startInterpo
// ============== Helper Functions ======================= //

// Map amount range [startAmount, stopAmount] to [0, 1] when amount is inside range.

}
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@ public boolean inputActionPerformed(AbstractViewInputHandler inputHandler, KeyEv
}
return true;
}
}
}

AnimationController uiAnimControl = new AnimationController();
AnimationController gotoAnimControl = new AnimationController();
@@ -182,7 +182,7 @@ public FlyViewInputHandler()
RollActionListener rollActionListener = new RollActionListener();
this.getAttributes().setActionListener(
ViewInputAttributes.DEVICE_KEYBOARD, ViewInputAttributes.VIEW_ROLL_KEYS, rollActionListener);

// Arrow Keys horizontal translate
this.getAttributes().setValues(ViewInputAttributes.DEVICE_KEYBOARD,
ViewInputAttributes.VIEW_HORIZONTAL_TRANS_KEYS,