Issue #1329 Fixed nsharp issue that came about after changing when the renderable display sets itself on the descriptor.

Change-Id: I1a5bcb4ba18a8dd73f8857c5bd4256529af57fde

Former-commit-id: 656a4500eb [formerly 08160fff31] [formerly fabb9bbcff] [formerly 656a4500eb [formerly 08160fff31] [formerly fabb9bbcff] [formerly 7e3273db95 [formerly fabb9bbcff [formerly 4b62eb9cb14005f5f1a4ab660336d2c6e6db0592]]]]
Former-commit-id: 7e3273db95
Former-commit-id: b912ede4c2 [formerly 3a1106efa0] [formerly 4287aae513311854dca459766b0660713bfe075e [formerly 904270b99b]]
Former-commit-id: 09a73da346014f11fd385751bf9b96d1d8a46914 [formerly 09f1499af9]
Former-commit-id: d0a39b6c17
This commit is contained in:
Max Schenkelberg 2012-12-20 17:14:34 -06:00
parent a78970da48
commit 5fb550377e
3 changed files with 18 additions and 11 deletions

View file

@ -333,17 +333,17 @@ public class FileLocker {
boolean gotLock = false; boolean gotLock = false;
File lockFile = new File(parentDir, "." + file.getName() + "_LOCK"); File lockFile = new File(parentDir, "." + file.getName() + "_LOCK");
try { try {
gotLock = lockFile.createNewFile(); long waitInterval = 500;
if (!gotLock) { long tryCount = MAX_WAIT / waitInterval;
long waitInterval = 500; long fileTime;
long tryCount = MAX_WAIT / waitInterval; for (int i = 0; !gotLock && i < tryCount; ++i) {
for (int i = 0; !gotLock && i < tryCount; ++i) { gotLock = lockFile.createNewFile()
try { || ((fileTime = lockFile.lastModified()) > 0 && (System
Thread.sleep(waitInterval); .currentTimeMillis() - fileTime) > MAX_WAIT);
} catch (InterruptedException e) { try {
// Ignore Thread.sleep(waitInterval);
} } catch (InterruptedException e) {
gotLock = lockFile.createNewFile(); // Ignore
} }
} }
} catch (IOException e) { } catch (IOException e) {
@ -355,6 +355,7 @@ public class FileLocker {
+ ", returning anyway"); + ", returning anyway");
Thread.dumpStack(); Thread.dumpStack();
} }
lockFile.setLastModified(System.currentTimeMillis());
lock.lockFile = lockFile; lock.lockFile = lockFile;
return gotLock; return gotLock;
} }

View file

@ -2609,6 +2609,9 @@ public class NsharpSkewTPaneResource extends NsharpAbstractPaneResource{
return; return;
IExtent ext = getDescriptor().getRenderableDisplay().getExtent(); IExtent ext = getDescriptor().getRenderableDisplay().getExtent();
ext.reset(); ext.reset();
if (ext.getWidth() == 0.0 || ext.getHeight() == 0.0) {
return;
}
//System.out.println("skewtPane: handleResize"); //System.out.println("skewtPane: handleResize");
this.rectangle = new Rectangle((int)ext.getMinX(), (int) ext.getMinY(), this.rectangle = new Rectangle((int)ext.getMinX(), (int) ext.getMinY(),
(int) ext.getWidth(), (int) ext.getHeight()); (int) ext.getWidth(), (int) ext.getHeight());

View file

@ -521,6 +521,9 @@ public class NsharpWitoPaneResource extends NsharpAbstractPaneResource{
super.handleResize(); super.handleResize();
IExtent ext = getDescriptor().getRenderableDisplay().getExtent(); IExtent ext = getDescriptor().getRenderableDisplay().getExtent();
ext.reset(); ext.reset();
if (ext.getWidth() == 0.0 || ext.getHeight() == 0.0) {
return;
}
this.rectangle = new Rectangle((int)ext.getMinX(), (int) ext.getMinY(), this.rectangle = new Rectangle((int)ext.getMinX(), (int) ext.getMinY(),
(int) ext.getWidth(), (int) ext.getHeight()); (int) ext.getWidth(), (int) ext.getHeight());
world = new WGraphics(this.rectangle); world = new WGraphics(this.rectangle);