用Python作GIS之三:入口程序 - stargui.py
"""
gui start file for Space-Time Analysis of Regional Systems
#STARS的图形用户界面入口(高级用户可以直接使用命令行方式进行操作)
----------------------------------------------------------------------
AUTHOR(S): Serge Rey
Mark V. Janikas
Boris Dev
----------------------------------------------------------------------
Copyright (c) 2000-2006 Sergio J. Rey
======================================================================
This source code is licensed under the GNU General Public License,
Version 2. See the file COPYING for more details.
======================================================================
OVERVIEW:
top module for stars gui. all modules should be imported into this module.
methods can be attached to menu callbacks.
#顶层程序,运行该文件时需要保证与其它调用文件在统一目录下
"""
import sys, os, string
from Tkinter import * # widget classes
from guimixin import * # mix-in methods
from guimaker import * # frame, plus menu/toolbar builder
from Numeric import *
import pickle
import os.path
import version
import time
VERSION = version.VERSION
VERSIONDATE = version.DATE
#以上为系统自带的包
from stars import *
import Esda
import Markov
import Inequality
import Mobility
import Data
import Markov
import eda
from Table import Table as RTable
from History import *
from SDialog import *
from pdf import *
import help
import DataViewer as DV
from kmean import Kmeans
import sdialogue as sd
import Utility
import STARSsmoothing as smooth
#以上为stars目录下的包
STARSHOME=options.getSTARSHOME()
PLATFORM=options.getPLATFORM()
ssTop = Tk()
ssTop.title("Welcome to STARS!")
ss=SplashScreen(master=ssTop)
#启动欢迎界面
# view modules
from gView import *
class SProject(Project):
...
class SBroadcast:
...
class SMap(Map,SBroadcast):
...
class STable(Table,SBroadcast):
...
class SMoranScatter(MoranScatter,SBroadcast):
...
class SDensity(Density,SBroadcast):
...
class SCDF(CDF,SBroadcast):
...
class SHistogram(Histogram,SBroadcast):
...
class STimeSeries(TimeSeries,SBroadcast):
...
class SBoxPlot(BoxPlot,SBroadcast):
...
class SpaceTimeButtonMatrix(View):
...
class STimePath(TimePath):
...
class SPCP(PCP):
...
class App(GuiMixin, GuiMaker): # or GuiMakerFrameMenu
"""application level class"""
#其中包含菜单定义与操作
...
if __name__ == '__main__':
import Tkinter
import sys
main = App()
main.disableMenus()
if len(sys.argv) == 1:
main.mainloop()
sys.exit()
else:
# below here are wrapper functions for shell
def openProject():
main.openProject()
def example():
main.example()
def catalogue():
print main.project.catalogue()
def matrixNames():
print main.getMatrixNames()
def openProject():
main.openProject()
def getVariable(name):
return main.project.getVariable(name)
def map(variable,t=[0]):
t=t[0]
title = "%s %s"%(variable.name,variable.timeString[t])
coords = main.project.coords
poly2cs = main.project.poly2cs
cs2poly = main.project.cs2poly
main.drawMap(title,coords,variable[:,t],variable.name,t,
poly2cs,cs2poly)
def boxPlot(variable,timePeriod = [0]):
t = timePeriod[0]
x = variable[:,t]
SBoxPlot(variable.name,main.project,main.master,
x= x,
csids = range(len(x)),
tsids = [t],
allX = variable)
def density(variable,timePeriod = [0]):
t=timePeriod[0]
yAll = variable
tsids = [t] * yAll.t
SDensity("Density",main.master,
main.project,y.name,y[:,t],csid=range(len(y)),
tsid = tsids,
title = "dtitle",xLabel=yAll.name,
xmin = None,
xmax = None)
def quit():
main.master.destroy()
sys.exit(0)
def disableMenus():
main.disableMenus()
用Python作GIS之三:入口程序 - stargui.py的更多相关文章
- 用Python作GIS之五:从示例入手—example函数
进入STARS后,最简单的学习方法就是演示示例数据.对于源码的分析也可以从这里入手. 以下为出发菜单项“Example Project”的函数example:def example(se ...
- 用Python作GIS之二:STARS开发环境配置
STARS的一般使用可以通过REGAL网页快速学习http://regionalanalysislab.org/?n=STARS再次不做详细介绍这里关注的主题是对STARS源代码分析即为使用Pytho ...
- 用Python作GIS之一:介入STARS
STARS的全称是Space-Time Analysis of Regional Systems,直译过来就是区域系统时空分析软件.这是针对区域多时相数据的分析包,源代码公开.该软件将最近几年发展起来 ...
- 用Python作GIS之四:Tkinter基本界面的搭建
Python下的主窗口可以定义如下:def start(self): #self.project = Project("temp") #self.pro ...
- python小练习之三---购物车程序
购物车购物的例子 严格来讲,这个例子相对大一些 功能也稍完备一些,具有用户登录,商品上架,用户购物,放入购物车,展示每个用户的购物车里的商品的数量,用户账户余额,支持用户账户充值等 下面展示的代码有些 ...
- 【python学习】新手基础程序练习(二)
Ι 继续上一节得内容,这里主要是对各种知识的理解以及如何运用. 一.执行 Python 脚本的两种方式 1.把python执行文件加到计算机的环境变量中,然后新建文件把程序写在新文件里,再通过cmd命 ...
- MVC入口程序 | 简单调用及实例化
入口程序: 现在大多采用单一入口机制,单一入口就是指在一个web应用程序中,所有的请求都指向一个脚本文件.通俗点说就是一幢大楼只有一个大门入口可以进去... 目录: 建立一个控制器/模型/视图调用函数 ...
- PHPCMS V9 框架代码分析(入口程序)
PHPCMS是采用MVC设计模式开发,基于模块和操作的方式进行访问,采用单一入口模式进行项目部署和访问,无论访问任何一个模块或者功能,只有一个统一的入口. 入口程序是在前期处理用户请求的引导程序.它是 ...
- Python打包项目为EXE程序
安装pyinstaller 如果使用了VirtualENV环境,则必须在要打包的项目环境中安装... 否则会找不到项目需求的包和模块 pip install -i https://pypi.douba ...
随机推荐
- android开发之路12(android四大组件&Fragment&AsyncTask类)
一.Activity组件1.简介:Activity组件是Android四大组件之一,通常一个Activity相当于一个用户界面,我们可以通过加载布局文件将Android提供的各种控件及自定义控件显示到 ...
- JS中String类型转换Date类型 并 计算时间差
JS中String类型转换Date类型 1.比较常用的方法,但繁琐,参考如下:主要使用Date的构造方法:Date(int year , int month , int day)<script& ...
- BZOJ 1827: [Usaco2010 Mar]gather 奶牛大集会 树形DP
[Usaco2010 Mar]gather 奶牛大集会 Bessie正在计划一年一度的奶牛大集会,来自全国各地的奶牛将来参加这一次集会.当然,她会选择最方便的地点来举办这次集会.每个奶牛居住在 N(1 ...
- $(function(){})与$(document).ready(function(){})
$(function(){ //jq ready()的简写 }); $(document).ready(function(){ // }); 或者: $().ready(function(){ //j ...
- MongoDB - The mongo Shell, Access the mongo Shell Help
In addition to the documentation in the MongoDB Manual, the mongo shell provides some additional inf ...
- PLSQL执行sql语句输出的中文是???之解决方法和步骤
方法/步骤 1 登陆plsql,执行sql语句,输出的中文标题显示成问号????:条件包含中文,则无数据输出 步骤阅读 2 输入sql语句select * from V$NLS_PARAMETERS查 ...
- js实现遮罩以及弹出可移动登录窗口
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- SignalR 简介
SignalR 简介 由帕特里克 · 弗莱彻|2013 年 2 月 27 日 英文原文地址:http://www.asp.net/signalr/overview/getting-started/in ...
- R语言快速入门
R语言是针对统计分析和数据科学的功能全面的开源语言,R的官方网址:http://www.r-project.org/ 在Windows环境下安装R是很方便的 R语言的两种运行模式:交互模式和批处理模 ...
- php学习笔记6--php中的文件包含 include,require,include_once,require_once
php中的文件包含 include,require,include_once,require_once 文件包含:是指将一个文件的内容包含进另外一个文件,有利于代码的复用等.php中文件包含指令有4个 ...