Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

gchart update

git-svn-id: https://pyjamas.svn.sourceforge.net/svnroot/pyjamas/trunk@1512 7a2bd370-bda8-463c-979e-2900ccfb811e
  • Loading branch information...
commit 02cf9afaf32031a687fe554bf75691e7eee1599c 1 parent c5ec2da
lkcl authored
View
4 examples/dynamictable/SchoolCalendarWidget.py
@@ -1,5 +1,5 @@
from pyjamas.ui.Composite import Composite
-from pyjamas.DeferredCommand import DeferredCommand
+from pyjamas import DeferredCommand
from SchoolCalendarService import SchoolCalendarService
from DynaTableWidget import DynaTableWidget
from Person import Person
@@ -78,7 +78,7 @@ def setDayIncluded(self, day, included):
if not self.pendingRefresh:
self.pendingRefresh = True
- DeferredCommand().add(self)
+ DeferredCommand.add(self)
def execute(self):
self.pendingRefresh = False
View
16 examples/gcharttestapp/GChartExample14.py
@@ -6,7 +6,7 @@
from pyjamas.chart import SymbolType
from pyjamas.chart import Double
-from pyjamas.DeferredCommand import DeferredCommand
+from pyjamas import DeferredCommand
from pyjamas.ui.Button import Button
@@ -47,7 +47,7 @@ def __init__(self, gchart, iCurve, phaseShift, n):
def execute(self):
for iC in range(self.iCurve, self.iCurve+self.n):
- if self.gchart.getNCurves() <= iCurve:
+ if self.gchart.getNCurves() <= self.iCurve:
# gchart.getCurve(0).getPoint(0).setY(
# gchart.getCurve(0).getPoint(0).getY())
self.gchart.addCurve()
@@ -89,11 +89,6 @@ def __init__(self):
self.phase = 0
self.btn = Button("Update", self)
- def onClick(self, event):
- self.phase += DELTA_PHASE
- for i in range(N_PERIODS):
- DeferredCommand().add(IncrementalUpdate(self, i, self.phase, 1))
-
self.setChartFootnotes(self.btn)
self.setChartSize(1000,100)
@@ -123,10 +118,13 @@ def onClick(self, event):
self.getCurve().getSymbol().setWidth(1)
for i in range(N_PERIODS):
- DeferredCommand().add(IncrementalUpdate(self, i, 0, 1))
+ DeferredCommand.add(IncrementalUpdate(self, i, 0, 1))
# for int phaseShift=0; phaseShift < N_PERIODS*PERIOD; phaseShift+=DELTA_PHASE)
# DeferredCommand.addCommand(IncrementalUpdate(this,0, phaseShift, N_PERIODS))
-
+ def onClick(self, event):
+ self.phase += DELTA_PHASE
+ for i in range(N_PERIODS):
+ DeferredCommand.add(IncrementalUpdate(self, i, self.phase, 1))
View
6 examples/gcharttestapp/GChartTestApp.py
@@ -1,7 +1,7 @@
import pyjd
pyjd.setup("./public/GChartTestApp.html")
-from pyjamas.DeferredCommand import DeferredCommand
+from pyjamas import DeferredCommand
from pyjamas.ui.HTML import HTML
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.Canvas2D import Canvas
@@ -98,10 +98,10 @@ def execute(self):
def addChart(gchart):
- DeferredCommand().add(AddOneChart(gchart, True))
+ DeferredCommand.add(AddOneChart(gchart, True))
def addChartNoUpdate(gchart):
- DeferredCommand().add(AddOneChart(gchart, False))
+ DeferredCommand.add(AddOneChart(gchart, False))
class GWTCanvasBasedCanvasFactory :
def create(self):
Please sign in to comment.
Something went wrong with that request. Please try again.