Echo 框架学习笔记 1

Echo 框架学习笔记 1
Nextapp.echo2.app:  主应用包
 
1. Nextapp.echo2.app.event

ChangeListener:状态改变监听器。包括状态改变行为

ChangeEvent:状态改变事件。

DocumentListener文本事件的监听器,包括文档更新行为

DocumentEvent:文本事件。

WindowPaneListener窗口关闭监听器。包括窗口关闭行为

WindowPaneEvent:窗口事件。

TableColumnModelListener: TableColumn监听器,包括列删除 添加 移动三个行为

TableColumnModelEventTableColumn更新事件,包括需要操作的列序号以及目标列序号

TableModelListener: TableModel监听器,只有table change 一个行为

TableModelEventTableModel事件,包括影响的列数,影响的模式,影响的第一列以及最后一列

ListDataListenerListData监听器,list内容改变  list item 添加或者删除行为。

ListDataEventListData事件,包括起源item  index 目标item index

ActionListeneraction event监听器,只有action perform 一个行为

ActionEventacticon 事件,传递command 作为外来参数

EventListenerList: 用于存储 Listener 的数据结构

2.Nextapp.echo2.app.table

TableCellRenderer:table cell 渲染接口。

DefaultTableCellRenderer:默认TableCellRender实现,返回Label.

TableModel:Tabel 格式下的数据model, 以列为单位,求得列的名字 ClassName

TableColumnModel:TableColumn数据model

DefaultTableColumnModelTableColumnModel具体实现。

TableColumn:描述Column对象,该对象具有head value两部分,为什么用PropertyChangeSupport通过 property change setXXX这些属性值?

DefaultTableModelTableModel具体实现。

AbstractTableModelTableModel的抽象类实现。

3.Nextapp.echo2.app.util:

Uidunique identifier. 对象hashcode +system time + count number 构成uid

DomUtil: Dom方式下的一些util 方法

PeerFactory:根据PropertyiesDiscovery 得到的Class name 来生成object

PropertiesDiscovery: 根据包含property 文件名的文件来读取所有property

ResizingArrayList:大小自动添加的ArrayList

 

4.Nextapp.echo2.app.text

Document:文本的model接口,可以添加文本和Document监听器。

AbstractDocumentDocument的抽象类, 完成listenerevent的绑定。

StringDocument:简单的一个 String document的实现.

TextComponentText 组件抽象类

5.Nextapp.echo2.app.list:(list 组件)

ListModellist组件的数据模型。添加list监听器

ListSelectionModel:在list 组件中选中的 Item数据模型。

ListCellRenderer根据list  item valueitem index 来渲染item的接口

StyledListCell表示渲染后的Item的一些信息,包括背景颜色,字体

AbstractListComponentList组件的抽象类

AbstractListModelListModel 的抽象类,EventListenerList用来存放EventListener,抽象类只是实现Listener event的绑定。

DefaultListModel:具体的实现添加删除Item.

DefaultListCellRenderer:具体实现

DefaultListSelectionModel:具体实现

 

6.Nextapp.echo2.app.layout

CellLayoutData:在cell layout下的一些属性信息。

GridLayoutData:  CellLayoutData基础上添加行间距和列间距。

RowLayoutData:在CellLayoutData基础上添加宽

ColumnLayoutData:在CellLayoutData基础上添加高

SplitPaneLayoutData:在可以splitPane layout 下的一些属性信息

TableLayoutData:空实现

 

7.Nextapp.echo2.app.button:

AbstractButton:button 的抽象类

ToggleButtonToggleButton的抽象类

ButtonGroup:管理radiobuttonsgroup,支持 renderid

ButtonModel:button 组件model 接口

DefaultButtonModel:具体实现

ToggleButtonModel只具有两种状态的toggle button model 接口,包括选中和不选中两种状态。

DefaultToggleButtonModel:具体实现

 

8.Nextapp.echo2.app.componentxml

PropertyXmlPeer:将DOM方式的XML 转换为相应的property

ComponentXmlException:  Component XML 异常

InvalidPropertyExceptionInvalid Property 异常

ComponentIntrospector:符合javabean规范,对echo 组件进行自检

PropertyLoader: "properties" Elements 元素转换为 map形式。

StyleSheetLoader:加载XML  style sheet

 

9.Nextapp.echo2.app.

componentxml.propertypeer

AlignmentPeer: 根据 XML 描述 得到Alignment

BooleanPeer: 根据 XML 描述 得到Boolean

BorderPeer: 根据 XML 描述 得到Border

ColorPeer: 根据 XML 描述 得到Color.

ExtentPeer: 根据 XML 描述 得到Extent

StringPeer: 根据 XML 描述 得到String

IntegerPeer: 根据 XML 描述 得到Integer

FillImageBorderPeer: 根据 XML 描述 得到FillImageBorder

FillImagePeer: 根据 XML 描述 得到FillImage

FontPeer: 根据 XML 描述 得到Font

InsetsPeer: 根据 XML 描述 得到Insets

LayoutDataPeer: 根据 XML 描述 得到LayoutData

ResourceImageReferencePeer: 根据 XML 描述 得到ResourceImageReference

10.Nextapp.echo2.app:  主应用包

Alignment:位置信息对象

ApplicationInstance:应用实例

AwtImageReferenceAWT方式下的ImageReference实现

ImageReference:图片信息接口,得到宽和高。支持RenderIdSupport

StreamImageReference:可对outputStream输出流的图片信息抽象类。

ResourceImageReference: StreamImageReference的一个具体实现。

HttpImageReference:通过HTTP 请求来得到的Image 引用。明显的特点是记录url

 

BorderBorder描述对象,具有extent  color  style 三个要素

Insets:矩形区域

Extent:表示线的距离,可以有很多单位方式

Command:可发任何command给客户端的接口

LayoutDirection:用来记录文字的方向性 有些语言的方向性是从右到左,如阿拉伯语。

Component:一个parent 一个ChildrenList,两个Style, 一个LayoutDirection,一个LayoutData,一个Locale,一个applicationInstance。他们得到Local的原则,先本类,如果没有在父类,然后在父类中的applicationInstance中找出。这个里面的setProperty

          GetProperty其实最终是 Style 中的setXXXgetXXX

 

LayoutData一个Component在父ComponentLayout信息接口,如 layout, position,color等其他信息

Pane画板接口。Panes include ContentPane, SplitPane and WindowPane

PaneContainerpane 容器接口

ContentPane:高层的容器,提供对内容区域和浮动windowpane的布局,包括backgroundImagehorizontalScrollverticalScroll。只能将FloatingPane作为Child。只有PaneContainerWindow 可以作为parent

FillImage:描述一个图片如何填充一个Component或者一个区域。包括 图片本身,位置,拷贝模式。

FloatingPane浮动pane接口

Window:顶层的window窗口。Window上面只有一个childContentPane

DerivedMutableStyle:如果没有本地设置Style,那么具有一个parent Style,一些属性从parent继承。

FillImageBorder:包括 八个FillImage用来表示四个角和四个边,一个BorderInsets,一个ContentInsets,一个Color描述FillImage.

Fonttext font, 包括 typeface, size, and styleTypeface表示字体,如罗马字体

Gridgrid component,它有方向性。是不是只有一维

IllegalChildException: 一个RuntimeException

Label: Label component,不可以添加child component

ModalSupportmodal state 支持接口

ListBox:具有选择一个或者多个Item的能力,具备一个ListModel和一个ListSelectionModel是一个组件。

StyleSheet:组件名相关的StyleCollection接口。

MutableStyleSheet:一个可变的StyleSheet具体实现。

PasswordField:单行输入且掩盖inputtext.

TextField:  单行输入文本框。

TextArea:多行输入文本框

RadioButtonradio button 组件

Rowrow 组件

SelectField:下拉选择域的组件

SplitPanesplit pane 的组件

Button:按钮对象,可设置icon Text  (AbstractButton)   icon 就是ImageReference

CheckBox: CheckBox对象  可设置icon Text ToggleButton

Column:一种Component,具有Border ,Insets, CellSpacing三个要素,这里的CellSpacingExtent对象来指定。

 

Color: 记录24-bit rgb 信息的颜色对象

Style: 表示样式风格信息的接口

MutableStyle:易变的Style的数据结构,包含PropertyNameIteratorIndexedPropertyValue两个内部类。这个结构为 propertyName  index  value三个元素对应。

RenderIdSupport:(接口)用来鉴别可以得到渲染支持的id号,它与一个给定的ApplicationInstance相关联,如果对象只关联单个ApplicationInstance.,那么ApplicationInstance.generateId()产生ID。如果关联多个ApplicationInstance,那么ApplicationInstance.generateSystemId()产生ID

Tabletable组件。

WindowPane:在一个可以移动可以浮动的window上渲染内容。

TaskQueueHandle表示一系列任务需要运行的处理接口

 

11.Nextapp.echo2.app.update

ClientComponentUpdate:客户端组件更新,包括 添加新的input 属性

PropertyUpdate:对象属性更新描述

ServerComponentUpdate服务端组件更新,包括 添加 删除 子组件或者父组件

ClientUpdateManager:客户端更新管理

ServerUpdateManager:服务器端更新管理

UpdateManager:统一更新管理

 
  备注:粗题表示接口
 
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Echo 是一个用 Go 语言开发的快速 HTTP 路由器(零内存分配)和微型 Web 框架。 特性: Zippy router. Extensible middleware/handler, supports: func(*echo.Context) http.Handler http.HandlerFunc func(http.ResponseWriter, *http.Request) func(*echo.Context) func(echo.HandlerFunc) echo.HandlerFunc func(http.Handler) http.Handler http.Handler http.HandlerFunc func(http.ResponseWriter, *http.Request) Middleware Handler Handy encoding/decoding functions. 支持静态文件处理 示例代码: package main import ( "net/http" "github.com/labstack/echo" mw "github.com/labstack/echo/middleware" "github.com/rs/cors" "github.com/thoas/stats" ) type user struct { ID string `json:"id"` Name string `json:"name"` } var users map[string]user func init() { users = map[string]user{ "1": user{ ID: "1", Name: "Wreck-It Ralph", }, } } func createUser(c *echo.Context) { u := new(user) if c.Bind(u) { users[u.ID] = *u c.JSON(http.StatusCreated, u) } } func getUsers(c *echo.Context) { c.JSON(http.StatusOK, users) } func getUser(c *echo.Context) { c.JSON(http.StatusOK, users[c.P(0)]) } func main() { e := echo.New() //*************************// // Built-in middleware // //*************************// e.Use(mw.Logger) //****************************// // Third-party middleware // //****************************// // https://github.com/rs/cors e.Use(cors.Default().Handler) // https://github.com/thoas/stats s := stats.New() e.Use(s.Handler) // Route e.Get("/stats", func(c *echo.Context) { c.JSON(200, s.Data()) }) // Serve index file e.Index("public/index.html") // Serve static files e.Static("/js", "public/js") //************// // Routes // //************// e.Post("/users", createUser) e.Get("/users", getUsers) e.Get("/users/:id", getUser) // Start server e.Run(":8080") } 标签:Echo  Web框架

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值