CN107608670A - The method and system that a kind of form UI elements are adaptively shown - Google Patents
The method and system that a kind of form UI elements are adaptively shown Download PDFInfo
- Publication number
- CN107608670A CN107608670A CN201610547992.9A CN201610547992A CN107608670A CN 107608670 A CN107608670 A CN 107608670A CN 201610547992 A CN201610547992 A CN 201610547992A CN 107608670 A CN107608670 A CN 107608670A
- Authority
- CN
- China
- Prior art keywords
- elements
- report
- size
- relative
- page
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Landscapes
- User Interface Of Digital Computer (AREA)
- Processing Or Creating Images (AREA)
Abstract
本发明提供一种报表UI元素自适应展示的方法及系统,该方法包括:计算样式报表的页面尺寸、样式报表中各个UI元素的相对大小和相对位置;根据移动终端显示屏的分辨率和所述样式报表的页面尺寸计算展示报表的页面尺寸与样式报表的页面尺寸的尺寸比例;根据所述样式报表的页面尺寸、所述尺寸比例、所述样式报表中各个UI元素的相对大小和相对位置计算各个UI元素在展示报表的大小和位置;根据所述样式报表的页面尺寸、所述尺寸比例、所述各个UI元素在展示报表的大小和位置绘制展示报表;在移动终端显示屏展示所述展示报表。本发明通过一份样式报表,根据移动终端分辨率的不同绘制与之相适应的展示报表,使得样式报表的各个UI元素能够自适应展示。
The present invention provides a method and system for self-adaptive display of report UI elements. The method includes: calculating the page size of the style report, the relative size and relative position of each UI element in the style report; According to the page size of the style report, calculate the size ratio between the page size of the display report and the page size of the style report; according to the page size of the style report, the size ratio, the relative size and relative position of each UI element in the style report Calculate the size and position of each UI element in the display report; draw the display report according to the page size of the style report, the size ratio, and the size and position of the various UI elements in the display report; display the display report on the mobile terminal display screen Display the report. The present invention uses a style report to draw corresponding display reports according to different mobile terminal resolutions, so that each UI element of the style report can be displayed adaptively.
Description
技术领域technical field
本发明涉及UI设计技术领域,更具体地说,涉及一种报表UI元素自适应展示的方法及系统。The present invention relates to the technical field of UI design, and more specifically, to a method and system for self-adaptive display of report UI elements.
背景技术Background technique
自从移动终端全面普及后,在不同移动终端界面上的UI元素展示要求越来越高,需要满足自适应展示在屏幕上。而目前使用的报表设计器是分别针对不同终端设计多套样式报表,不同的移动终端加载适合自己分辨率的样式报表进行展示。Since the popularity of mobile terminals, the display requirements for UI elements on different mobile terminal interfaces have become higher and higher, and they need to meet the requirements of adaptive display on the screen. However, the currently used report designer is to design multiple sets of style reports for different terminals, and different mobile terminals load the style reports suitable for their own resolutions for display.
发明内容Contents of the invention
本发明提出一种报表UI元素自适应展示的方法及系统,能够使得一份样式报表的各个UI元素在不同分辨率的移动终端自适应展示。The present invention proposes a method and system for self-adaptive display of UI elements of a report, which can make each UI element of a style report self-adaptively displayed on mobile terminals with different resolutions.
为此,本发明提出以下技术方案:For this reason, the present invention proposes following technical scheme:
第一方面,一种报表UI元素自适应展示的方法,包括:In the first aspect, a method for adaptively displaying report UI elements includes:
计算样式报表的页面尺寸、样式报表中各个UI元素的相对大小和相对位置;Calculate the page size of the style report, the relative size and relative position of each UI element in the style report;
根据移动终端显示屏的分辨率和所述样式报表的页面尺寸计算展示报表的页面尺寸与样式报表的页面尺寸的尺寸比例;Calculating the ratio of the page size of the display report to the page size of the style report according to the resolution of the display screen of the mobile terminal and the page size of the style report;
根据所述样式报表的页面尺寸、所述尺寸比例、所述样式报表中各个UI元素的相对大小和相对位置计算各个UI元素在展示报表的大小和位置;Calculate the size and position of each UI element in the display report according to the page size of the style report, the size ratio, the relative size and relative position of each UI element in the style report;
根据所述样式报表的页面尺寸、所述尺寸比例、所述各个UI元素在展示报表的大小和位置绘制展示报表;Draw a display report according to the page size of the style report, the size ratio, and the size and position of each UI element in the display report;
在移动终端显示屏展示所述展示报表。The display report is displayed on the display screen of the mobile terminal.
其中,所述样式报表的页面尺寸包括样式报表的页面宽度和样式报表的页面高度;Wherein, the page size of the style report includes the page width of the style report and the page height of the style report;
以样式报表的右上角为原点,水平向右为X轴正向,竖直向下为Y轴正向建立直角坐标系;Take the upper right corner of the style report as the origin, horizontally to the right is the positive direction of the X-axis, and vertically downward is the positive direction of the Y-axis to establish a rectangular coordinate system;
所述样式报表中各个UI元素的相对大小包括:各个UI元素的相对宽度Wn和相对高度Hn;The relative size of each UI element in the style report includes: the relative width Wn and the relative height Hn of each UI element;
所述样式报表中各个UI元素的相对位置包括:各个UI元素的起点横向位置Xn和起点纵向位置Yn;The relative position of each UI element in the style report includes: the starting point horizontal position Xn and the starting point vertical position Yn of each UI element;
相对宽度Wn表示UI元素的宽度相对于报表的页面宽度的百分比;The relative width Wn represents the percentage of the width of the UI element relative to the page width of the report;
相对高度Hn表示UI元素的高度相对于报表的页面高度的百分比;The relative height Hn indicates the percentage of the height of the UI element relative to the page height of the report;
起点横向位置Xn表示UI元素的起点横坐标相对于报表的页面宽度的百分比;The horizontal position Xn of the starting point represents the percentage of the horizontal coordinate of the starting point of the UI element relative to the page width of the report;
起点纵向位置Yn表示UI元素的起点纵坐标相对于报表的页面宽度的百分比。The vertical position Yn of the starting point represents the percentage of the vertical coordinate of the starting point of the UI element relative to the page width of the report.
其中,所述尺寸比例包括高度比例和宽度比例;Wherein, the size ratio includes a height ratio and a width ratio;
所述根据所述样式报表的页面尺寸、所述尺寸比例、所述样式报表中各个UI元素的相对大小和相对位置计算各个UI元素在展示报表的大小和位置,包括:According to the page size of the style report, the size ratio, the relative size and relative position of each UI element in the style report, the calculation of the size and position of each UI element in the display report includes:
根据所述样式报表的页面宽度、所述宽度比例和所述相对宽度Wn计算各个UI元素在展示报表的宽度;Calculate the width of each UI element displaying the report according to the page width of the style report, the width ratio and the relative width Wn;
根据所述样式报表的页面高度、所述高度比例和所述相对高度Hn计算各个UI元素在展示报表的高度;Calculate the height of each UI element displaying the report according to the page height of the style report, the height ratio and the relative height Hn;
根据所述样式报表的页面宽度、所述宽度比例和所述起点横向位置Xn计算各个UI元素在展示报表的起点横坐标;Calculate the abscissa of the starting point of each UI element in the display report according to the page width of the style report, the width ratio and the horizontal position Xn of the starting point;
根据所述样式报表的页面高度、所述高度比例和所述起点纵向位置Yn计算各个UI元素在展示报表的起点纵坐标;According to the page height of the style report, the height ratio and the vertical position Yn of the starting point, calculate the starting ordinate of each UI element in the display report;
所述展示报表的右上角为坐标原点,水平向右为X轴正向,竖直向下为Y轴正向。The upper right corner of the displayed report is the coordinate origin, the horizontal direction to the right is the positive direction of the X axis, and the vertical direction is the positive direction of the Y axis.
其中,所述根据所述样式报表的页面尺寸、所述尺寸比例、所述各个UI元素在展示报表的大小和位置绘制展示报表,包括:Wherein, the drawing of the display report according to the page size of the style report, the size ratio, and the size and position of each UI element includes:
根据所述样式报表的页面尺寸和所述尺寸比例计算展示报表的页面尺寸;calculating the page size of the display report according to the page size of the style report and the size ratio;
根据展示报表的页面尺寸、各个UI元素在展示报表的起点横坐标、各个UI元素在展示报表的起点纵坐标、各个UI元素在展示报表的宽度和各个UI元素在展示报表的高度绘制展示报表。Draw the display report according to the page size of the display report, the abscissa of the starting point of each UI element in the display report, the vertical coordinate of the starting point of each UI element in the display report, the width of each UI element in the display report, and the height of each UI element in the display report.
其中,所述计算样式报表的页面尺寸、样式报表中各个UI元素的大小和位置之前,还包括:Wherein, before the page size of the calculation style report, the size and position of each UI element in the style report, it also includes:
设计样式报表;design style report;
解析所述样式报表,获得样式报表中的各个UI元素。The style report is parsed to obtain each UI element in the style report.
第二方面一种报表UI元素自适应展示的系统,包括:The second aspect is a system for adaptively displaying report UI elements, including:
第一计算模块,用于计算样式报表的页面尺寸、样式报表中各个UI元素的相对大小和相对位置;The first calculation module is used to calculate the page size of the style report, the relative size and relative position of each UI element in the style report;
第二计算模块,用于根据移动终端显示屏的分辨率和所述样式报表的页面尺寸计算展示报表的页面尺寸与样式报表的页面尺寸的尺寸比例;The second calculation module is used to calculate the size ratio between the page size of the display report and the page size of the style report according to the resolution of the display screen of the mobile terminal and the page size of the style report;
第三计算模块,用于根据所述样式报表的页面尺寸、所述尺寸比例、所述样式报表中各个UI元素的相对大小和相对位置计算各个UI元素在展示报表的大小和位置;The third calculation module is used to calculate the size and position of each UI element in the display report according to the page size of the style report, the size ratio, the relative size and relative position of each UI element in the style report;
绘制模块,用于根据所述样式报表的页面尺寸、所述尺寸比例、所述各个UI元素在展示报表的大小和位置绘制展示报表;A drawing module, configured to draw a display report according to the page size of the style report, the size ratio, and the size and position of each UI element in the display report;
展示模块,用于在移动终端显示屏展示所述展示报表。The display module is configured to display the display report on the display screen of the mobile terminal.
其中,所述样式报表的页面尺寸包括样式报表的页面宽度和样式报表的页面高度;Wherein, the page size of the style report includes the page width of the style report and the page height of the style report;
以样式报表的右上角为原点,水平向右为X轴正向,竖直向下为Y轴正向建立直角坐标系;Take the upper right corner of the style report as the origin, horizontally to the right is the positive direction of the X-axis, and vertically downward is the positive direction of the Y-axis to establish a rectangular coordinate system;
所述样式报表中各个UI元素的相对大小包括:各个UI元素的相对宽度Wn和相对高度Hn;The relative size of each UI element in the style report includes: the relative width Wn and the relative height Hn of each UI element;
所述样式报表中各个UI元素的相对位置包括:各个UI元素的起点横向位置Xn和起点纵向位置Yn;The relative position of each UI element in the style report includes: the starting point horizontal position Xn and the starting point vertical position Yn of each UI element;
相对宽度Wn表示UI元素的宽度相对于报表的页面宽度的百分比;The relative width Wn represents the percentage of the width of the UI element relative to the page width of the report;
相对高度Hn表示UI元素的高度相对于报表的页面高度的百分比;The relative height Hn indicates the percentage of the height of the UI element relative to the page height of the report;
起点横向位置Xn表示UI元素的起点横坐标相对于报表的页面宽度的百分比;The horizontal position Xn of the starting point represents the percentage of the horizontal coordinate of the starting point of the UI element relative to the page width of the report;
起点纵向位置Yn表示UI元素的起点纵坐标相对于报表的页面宽度的百分比。The vertical position Yn of the starting point represents the percentage of the vertical coordinate of the starting point of the UI element relative to the page width of the report.
其中,所述尺寸比例包括高度比例和宽度比例;Wherein, the size ratio includes a height ratio and a width ratio;
所述第三计算模块具体用于:The third calculation module is specifically used for:
根据所述样式报表的页面宽度、所述宽度比例和所述相对宽度Wn计算各个UI元素在展示报表的宽度;Calculate the width of each UI element displaying the report according to the page width of the style report, the width ratio and the relative width Wn;
根据所述样式报表的页面高度、所述高度比例和所述相对高度Hn计算各个UI元素在展示报表的高度;Calculate the height of each UI element displaying the report according to the page height of the style report, the height ratio and the relative height Hn;
根据所述样式报表的页面宽度、所述宽度比例和所述起点横向位置Xn计算各个UI元素在展示报表的起点横坐标;Calculate the abscissa of the starting point of each UI element in the display report according to the page width of the style report, the width ratio and the horizontal position Xn of the starting point;
根据所述样式报表的页面高度、所述高度比例和所述起点纵向位置Yn计算各个UI元素在展示报表的起点纵坐标;According to the page height of the style report, the height ratio and the vertical position Yn of the starting point, calculate the starting ordinate of each UI element in the display report;
所述展示报表的右上角为坐标原点,水平向右为X轴正向,竖直向下为Y轴正向。The upper right corner of the displayed report is the coordinate origin, the horizontal direction to the right is the positive direction of the X axis, and the vertical direction is the positive direction of the Y axis.
其中,所述绘制模块具体用于:Wherein, the drawing module is specifically used for:
根据所述样式报表的页面尺寸和所述尺寸比例计算展示报表的页面尺寸;calculating the page size of the display report according to the page size of the style report and the size ratio;
根据展示报表的页面尺寸、各个UI元素在展示报表的起点横坐标、各个UI元素在展示报表的起点纵坐标、各个UI元素在展示报表的宽度和各个UI元素在展示报表的高度绘制展示报表。Draw the display report according to the page size of the display report, the abscissa of the starting point of each UI element in the display report, the vertical coordinate of the starting point of each UI element in the display report, the width of each UI element in the display report, and the height of each UI element in the display report.
其中,所述系统还包括:Wherein, the system also includes:
设计模块,用于设计样式报表;Design module, used to design style reports;
解析模块,用于解析所述样式报表,获得样式报表中的各个UI元素。The parsing module is configured to parse the style report to obtain each UI element in the style report.
本发明提供一种报表UI元素自适应展示的方法及系统,通过一份样式报表,根据移动终端分辨率的不同绘制与之相适应的展示报表,一份样式报表的各个UI元素在不同分辨率的移动终端能够自适应展示,不会变形。The present invention provides a method and system for self-adaptive display of report UI elements. Through a style report, according to the different resolutions of mobile terminals, the corresponding display report is drawn, and each UI element of a style report is displayed at different resolutions The mobile terminal can be displayed adaptively without deformation.
附图说明Description of drawings
图1是本发明提供的一种报表UI元素自适应展示的方法第一实施例的方法流程图。FIG. 1 is a flow chart of a first embodiment of a method for adaptively displaying report UI elements provided by the present invention.
图2是本发明提供的一种报表UI元素自适应展示的方法第二实施例的方法流程图。FIG. 2 is a method flow chart of a second embodiment of a method for adaptively displaying report UI elements provided by the present invention.
图3是本发明提供的一种报表UI元素自适应展示的系统第一实施例的结构方框图。Fig. 3 is a structural block diagram of a first embodiment of a system for adaptive display of report UI elements provided by the present invention.
图4是本发明提供的一种报表UI元素自适应展示的系统第二实施例的结构方框图。Fig. 4 is a structural block diagram of a second embodiment of a system for adaptive display of report UI elements provided by the present invention.
具体实施方式detailed description
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.
实施例一Embodiment one
如图1所示,一种报表UI元素自适应展示的方法,包括以下步骤:As shown in Figure 1, a method for adaptively displaying report UI elements includes the following steps:
S101、计算样式报表的页面尺寸、样式报表中各个UI元素的相对大小和相对位置。S101. Calculate the page size of the style report, and the relative size and relative position of each UI element in the style report.
当一套样式报表被设计出来之后,记录其页面尺寸、各个UI元素的相对大小、相对位置。When a style report is designed, record its page size, relative size and relative position of each UI element.
S102、根据移动终端显示屏的分辨率和所述样式报表的页面尺寸计算展示报表的页面尺寸与样式报表的页面尺寸的尺寸比例。S102. Calculate a size ratio between the page size of the display report and the page size of the style report according to the resolution of the display screen of the mobile terminal and the page size of the style report.
不同的移动终端其显示屏的分辨率不同,同样的样式报表必然不能与所有的移动终端显示屏的分辨率相适应,因此,当要在不同的移动终端展示这套样式报表时,需要对该样式报表做适应于移动终端显示屏的分辨率的调整,即需要修改样式报表的尺寸大小以满足移动终端显示屏的分辨率。本发明实施例以样式报表作为模板,根据移动终端显示屏的分辨率和所述样式报表的页面尺寸计算展示报表的页面尺寸与样式报表的页面尺寸的尺寸比例,根据该比例尺寸绘制一份与该模板中UI元素相同但尺寸不同的展示报表,以便展示,且UI元素不变形,同时提高样式报表的复用率。Different mobile terminals have different screen resolutions, and the same style report cannot adapt to the resolution of all mobile terminal screens. Therefore, when displaying this set of style reports on different mobile terminals, it is necessary to The style report is adjusted to the resolution of the display screen of the mobile terminal, that is, the size of the style report needs to be modified to meet the resolution of the display screen of the mobile terminal. The embodiment of the present invention uses the style report as a template, calculates the size ratio between the page size of the display report and the page size of the style report according to the resolution of the display screen of the mobile terminal and the page size of the style report, and draws a copy according to the ratio size In this template, the display report with the same UI elements but different sizes is easy to display, and the UI elements are not deformed, and the reuse rate of the style report is improved at the same time.
S103、根据所述样式报表的页面尺寸、所述尺寸比例、所述样式报表中各个UI元素的相对大小和相对位置计算各个UI元素在展示报表的大小和位置。S103. Calculate the size and position of each UI element in the display report according to the page size of the style report, the size ratio, and the relative size and relative position of each UI element in the style report.
要得到一份新的报表(展示报表),需要计算出展示报表的页面尺寸,各个UI元素在展示报表的大小和位置。To get a new report (display report), it is necessary to calculate the page size of the display report, and the size and position of each UI element in the display report.
展示报表的页面尺寸通过展示报表的页面尺寸与样式报表的页面尺寸的尺寸比例以及样式报表的页面尺寸得出,展示报表的页面尺寸=尺寸比例*样式报表的页面尺寸。The page size of the display report is obtained from the ratio of the page size of the display report to the page size of the style report and the page size of the style report. The page size of the display report = size ratio * page size of the style report.
各个UI元素在展示报表的大小与其在样式报表的相对大小、展示报表的页面尺寸与样式报表的页面尺寸的尺寸比例、以及展示报表的页面尺寸有关,因此,根据它们之间的关系可以计算出各个UI元素在展示报表的大小:UI元素在展示报表的大小=样式报表的页面尺寸*样式报表中UI元素的相对大小*尺寸比例;同理可计算出各个UI元素在展示报表的位置。The size of each UI element in the display report is related to the relative size of the style report, the size ratio of the page size of the display report to the page size of the style report, and the page size of the display report. Therefore, according to the relationship between them, it can be calculated The size of each UI element in the display report: the size of the UI element in the display report = the page size of the style report * the relative size of the UI elements in the style report * the size ratio; similarly, the position of each UI element in the display report can be calculated.
UI元素的相对大小或相对位置采用UI元素的实际大小或实际位置相对于页面尺寸的百分比表示。The relative size or relative position of the UI element is represented by the percentage of the actual size or actual position of the UI element relative to the page size.
S104、根据所述样式报表的页面尺寸、所述尺寸比例、所述各个UI元素在展示报表的大小和位置绘制展示报表。S104. Draw a display report according to the page size of the style report, the size ratio, and the size and position of each UI element.
S105、在移动终端显示屏展示所述展示报表。S105. Display the display report on the display screen of the mobile terminal.
计算出展示报表的页面尺寸,各个UI元素在展示报表的大小和位置之后便可以根据这些参数绘制展示报表,展示报表绘制完成之后便可以展示在移动终端的屏幕上,其中的UI元素不变形。Calculate the page size of the display report. After each UI element displays the size and position of the report, the display report can be drawn according to these parameters. After the display report is drawn, it can be displayed on the screen of the mobile terminal, and the UI elements in it will not be deformed.
本发明实施例提供的一种报表UI元素自适应展示的方法,通过一套样式报表,根据移动终端分辨率的不同绘制与之相适应的展示报表,一套样式报表的各个UI元素在不同分辨率的移动终端能够自适应展示,不会变形,同时提高样式报表的复用率。The embodiment of the present invention provides a method for self-adaptive display of report UI elements. Through a set of style reports, according to the different resolutions of mobile terminals, the corresponding display reports are drawn. Each UI element of a set of style reports is displayed in different High-rate mobile terminals can display adaptively without deformation, and at the same time improve the reuse rate of style reports.
实施例二Embodiment two
本实施例的一种报表UI元素自适应展示的方法,是在实施例一的基础上补充内容,本实施例尚未详尽的内容参考实施例一。A method for self-adaptive display of UI elements of a report in this embodiment is to supplement content on the basis of Embodiment 1, and refer to Embodiment 1 for details not yet detailed in this embodiment.
如图2所示,一种报表UI元素自适应展示的方法,包括以下步骤:As shown in Figure 2, a method for adaptively displaying report UI elements includes the following steps:
S201、设计样式报表。S201. Design a style report.
S202、解析所述样式报表,获得样式报表中的各个UI元素。S202. Parse the style report to obtain each UI element in the style report.
S203、计算样式报表的页面尺寸、样式报表中各个UI元素的相对大小和相对位置。S203. Calculate the page size of the style report, and the relative size and relative position of each UI element in the style report.
报表设计器设计出一套报表样式,报表解析引擎负责解析报表类型和报表数据,得到样式报表中的各个UI元素,样式报表中的各个UI元素的相对大小和相对位置。The report designer designs a set of report styles, and the report analysis engine is responsible for analyzing the report type and report data, and obtains each UI element in the style report, and the relative size and relative position of each UI element in the style report.
优选的,样式报表的页面尺寸包括样式报表的页面宽度和样式报表的页面高度。Preferably, the page size of the style report includes the page width of the style report and the page height of the style report.
样式报表中各个UI元素的相对大小包括:各个UI元素的相对宽度Wn和相对高度Hn。The relative size of each UI element in the style report includes: the relative width Wn and the relative height Hn of each UI element.
相对宽度Wn表示UI元素的宽度相对于报表的页面宽度的百分比;相对高度Hn表示UI元素的高度相对于报表的页面高度的百分比。The relative width Wn represents the percentage of the width of the UI element relative to the page width of the report; the relative height Hn represents the percentage of the height of the UI element relative to the page height of the report.
所述样式报表中各个UI元素的相对位置包括:各个UI元素的起点横向位置Xn和起点纵向位置Yn。The relative position of each UI element in the style report includes: the starting point horizontal position Xn and the starting point vertical position Yn of each UI element.
以样式报表的右上角为原点,水平向右为X轴正向,竖直向下为Y轴正向建立直角坐标系,起点横向位置Xn表示UI元素的起点横坐标相对于报表的页面宽度的百分比,起点纵向位置Yn表示UI元素的起点纵坐标相对于报表的页面宽度的百分比。Take the upper right corner of the style report as the origin, horizontally to the right as the positive direction of the X-axis, and vertically downward as the positive direction of the Y-axis to establish a Cartesian coordinate system. The horizontal position Xn of the starting point represents the abscissa of the starting point of the UI element relative to the page width of the report. Percentage, starting point vertical position Yn indicates the percentage of the starting point vertical coordinate of the UI element relative to the page width of the report.
S204、根据移动终端显示屏的分辨率和所述样式报表的页面尺寸计算展示报表的页面尺寸与样式报表的页面尺寸的尺寸比例。S204. Calculate a size ratio between the page size of the display report and the page size of the style report according to the resolution of the display screen of the mobile terminal and the page size of the style report.
S205、根据所述样式报表的页面尺寸、所述尺寸比例、所述样式报表中各个UI元素的相对大小和相对位置计算各个UI元素在展示报表的大小和位置。S205. Calculate the size and position of each UI element in the display report according to the page size of the style report, the size ratio, and the relative size and relative position of each UI element in the style report.
优选的,所述尺寸比例包括高度比例和宽度比例;Preferably, the size ratio includes a height ratio and a width ratio;
计算各个UI元素在展示报表的大小和位置的过程如下:The process of calculating the size and position of each UI element in the display report is as follows:
根据所述样式报表的页面宽度、所述宽度比例和所述相对宽度Wn计算各个UI元素在展示报表的宽度:UI元素在展示报表的宽度=样式报表的页面宽度*宽度比例*相对宽度Wn。Calculate the width of each UI element in the display report according to the page width of the style report, the width ratio and the relative width Wn: UI element width in the display report=page width*width ratio*relative width Wn of the style report.
根据所述样式报表的页面高度、所述高度比例和所述相对高度Hn计算各个UI元素在展示报表的高度:UI元素在展示报表的高度=样式报表的页面高度*高度比例*相对高度Hn。Calculate the height of each UI element in the display report according to the page height of the style report, the height ratio and the relative height Hn: the height of the UI element in the display report=the page height of the style report*height ratio*relative height Hn.
根据所述样式报表的页面宽度、所述宽度比例和所述起点横向位置Xn计算各个UI元素在展示报表的起点横坐标:UI元素在展示报表的起点横坐标=样式报表的页面宽度*宽度比例*起点横向位置Xn。Calculate the starting abscissa of each UI element in the display report according to the page width of the style report, the width ratio and the starting horizontal position Xn: UI element abscissa of the starting point of the display report=page width*width ratio of the style report * The horizontal position Xn of the starting point.
根据所述样式报表的页面高度、所述高度比例和所述起点纵向位置Yn计算各个UI元素在展示报表的起点纵坐标:UI元素在展示报表的起点纵坐标=样式报表的页面高度*高度比例*起点纵向位置Yn。According to the page height of the style report, the height ratio and the starting point vertical position Yn, calculate the starting point ordinate of each UI element in the display report: the starting point ordinate of the UI element in the display report=page height*height ratio of the style report * Longitudinal position Yn of starting point.
UI元素在展示报表的起点坐标所在的直角坐标系以所述展示报表的右上角为坐标原点,水平向右为X轴正向,竖直向下为Y轴正向建立。The Cartesian coordinate system where the starting point coordinates of the UI elements in the display report is located takes the upper right corner of the display report as the origin of the coordinates, the horizontal direction to the right is the positive direction of the X axis, and the vertical direction is the positive direction of the Y axis.
S206、根据所述样式报表的页面尺寸、所述尺寸比例、所述各个UI元素在展示报表的大小和位置绘制展示报表。S206. Draw a display report according to the page size of the style report, the size ratio, and the size and position of each UI element.
优选的,所述步骤S206包括:Preferably, said step S206 includes:
根据所述样式报表的页面尺寸和所述尺寸比例计算展示报表的页面尺寸:展示报表的页面尺寸=样式报表的页面尺寸*尺寸比例。Calculate the page size of the display report according to the page size of the style report and the size ratio: page size of the display report=page size of the style report*size ratio.
根据展示报表的页面尺寸、各个UI元素在展示报表的起点横坐标、各个UI元素在展示报表的起点纵坐标、各个UI元素在展示报表的宽度和各个UI元素在展示报表的高度绘制展示报表。Draw the display report according to the page size of the display report, the abscissa of the starting point of each UI element in the display report, the vertical coordinate of the starting point of each UI element in the display report, the width of each UI element in the display report, and the height of each UI element in the display report.
S207、在移动终端显示屏展示所述展示报表。S207. Display the presentation report on the display screen of the mobile terminal.
本发明实施例提供的一种报表UI元素自适应展示的方法,通过一套样式报表,根据移动终端分辨率的不同绘制与之相适应的展示报表,一套样式报表的各个UI元素在不同分辨率的移动终端能够自适应展示,不会变形。The embodiment of the present invention provides a method for self-adaptive display of report UI elements. Through a set of style reports, according to the different resolutions of mobile terminals, the corresponding display reports are drawn. Each UI element of a set of style reports is displayed in different High-speed mobile terminals can display adaptively without deformation.
实施例三Embodiment three
本实施例提供一种报表UI元素自适应展示的系统,与实施例一的方法相对应,本实施例尚未详尽的内容参考实施例一。This embodiment provides a system for self-adaptive display of report UI elements, which corresponds to the method in Embodiment 1. Refer to Embodiment 1 for details not yet detailed in this embodiment.
参考图3,一种报表UI元素自适应展示的系统,包括:Referring to Figure 3, a system for adaptive display of report UI elements, including:
第一计算模块101,用于计算样式报表的页面尺寸、样式报表中各个UI元素的相对大小和相对位置;The first calculation module 101 is used to calculate the page size of the style report, the relative size and relative position of each UI element in the style report;
第二计算模块102,用于根据移动终端显示屏的分辨率和所述样式报表的页面尺寸计算展示报表的页面尺寸与样式报表的页面尺寸的尺寸比例;The second calculation module 102 is used to calculate the size ratio of the page size of the display report and the page size of the style report according to the resolution of the display screen of the mobile terminal and the page size of the style report;
第三计算模块103,用于根据所述样式报表的页面尺寸、所述尺寸比例、所述样式报表中各个UI元素的相对大小和相对位置计算各个UI元素在展示报表的大小和位置;The third calculation module 103 is used to calculate the size and position of each UI element in the display report according to the page size of the style report, the size ratio, the relative size and relative position of each UI element in the style report;
绘制模块104,用于根据所述样式报表的页面尺寸、所述尺寸比例、所述各个UI元素在展示报表的大小和位置绘制展示报表;A drawing module 104, configured to draw a display report according to the page size of the style report, the size ratio, and the size and position of each UI element;
展示模块105,用于在移动终端显示屏展示所述展示报表。The display module 105 is configured to display the display report on the display screen of the mobile terminal.
实施例四Embodiment four
本实施例提供一种报表UI元素自适应展示的系统,与实施例二的方法相对应,本实施例尚未详尽的内容参考实施例二。This embodiment provides a system for self-adaptive display of report UI elements, which corresponds to the method in Embodiment 2. Refer to Embodiment 2 for details not yet detailed in this embodiment.
参考图4,一种报表UI元素自适应展示的系统,包括:Referring to Figure 4, a system for adaptive display of report UI elements, including:
设计模块201,用于设计样式报表;Design module 201, used to design a style report;
解析模块202,用于解析所述样式报表,获得样式报表中的各个UI元素。The parsing module 202 is configured to parse the style report to obtain each UI element in the style report.
第一计算模块203,用于计算样式报表的页面尺寸、样式报表中各个UI元素的相对大小和相对位置;The first calculation module 203 is used to calculate the page size of the style report, the relative size and relative position of each UI element in the style report;
第二计算模块204,用于根据移动终端显示屏的分辨率和所述样式报表的页面尺寸计算展示报表的页面尺寸与样式报表的页面尺寸的尺寸比例;The second calculation module 204 is used to calculate the size ratio between the page size of the display report and the page size of the style report according to the resolution of the display screen of the mobile terminal and the page size of the style report;
第三计算模块205,用于根据所述样式报表的页面尺寸、所述尺寸比例、所述样式报表中各个UI元素的相对大小和相对位置计算各个UI元素在展示报表的大小和位置;The third calculation module 205 is used to calculate the size and position of each UI element in the display report according to the page size of the style report, the size ratio, the relative size and relative position of each UI element in the style report;
绘制模块206,用于根据所述样式报表的页面尺寸、所述尺寸比例、所述各个UI元素在展示报表的大小和位置绘制展示报表;A drawing module 206, configured to draw the display report according to the page size of the style report, the size ratio, and the size and position of each UI element;
展示模块207,用于在移动终端显示屏展示所述展示报表。The display module 207 is configured to display the display report on the display screen of the mobile terminal.
优选的,所述样式报表的页面尺寸包括样式报表的页面宽度和样式报表的页面高度;Preferably, the page size of the style report includes the page width of the style report and the page height of the style report;
以样式报表的右上角为原点,水平向右为X轴正向,竖直向下为Y轴正向建立直角坐标系;Take the upper right corner of the style report as the origin, horizontally to the right is the positive direction of the X-axis, and vertically downward is the positive direction of the Y-axis to establish a rectangular coordinate system;
所述样式报表中各个UI元素的相对大小包括:各个UI元素的相对宽度Wn和相对高度Hn;The relative size of each UI element in the style report includes: the relative width Wn and the relative height Hn of each UI element;
所述样式报表中各个UI元素的相对位置包括:各个UI元素的起点横向位置Xn和起点纵向位置Yn;The relative position of each UI element in the style report includes: the starting point horizontal position Xn and the starting point vertical position Yn of each UI element;
相对宽度Wn表示UI元素的宽度相对于报表的页面宽度的百分比;The relative width Wn represents the percentage of the width of the UI element relative to the page width of the report;
相对高度Hn表示UI元素的高度相对于报表的页面高度的百分比;The relative height Hn indicates the percentage of the height of the UI element relative to the page height of the report;
起点横向位置Xn表示UI元素的起点横坐标相对于报表的页面宽度的百分比;The horizontal position Xn of the starting point represents the percentage of the horizontal coordinate of the starting point of the UI element relative to the page width of the report;
起点纵向位置Yn表示UI元素的起点纵坐标相对于报表的页面宽度的百分比。The vertical position Yn of the starting point represents the percentage of the vertical coordinate of the starting point of the UI element relative to the page width of the report.
优选的,所述尺寸比例包括高度比例和宽度比例;Preferably, the size ratio includes a height ratio and a width ratio;
所述第三计算模块205具体用于:The third calculation module 205 is specifically used for:
根据所述样式报表的页面宽度、所述宽度比例和所述相对宽度Wn计算各个UI元素在展示报表的宽度;Calculate the width of each UI element displaying the report according to the page width of the style report, the width ratio and the relative width Wn;
根据所述样式报表的页面高度、所述高度比例和所述相对高度Hn计算各个UI元素在展示报表的高度;Calculate the height of each UI element displaying the report according to the page height of the style report, the height ratio and the relative height Hn;
根据所述样式报表的页面宽度、所述宽度比例和所述起点横向位置Xn计算各个UI元素在展示报表的起点横坐标;Calculate the abscissa of the starting point of each UI element in the display report according to the page width of the style report, the width ratio and the horizontal position Xn of the starting point;
根据所述样式报表的页面高度、所述高度比例和所述起点纵向位置Yn计算各个UI元素在展示报表的起点纵坐标;According to the page height of the style report, the height ratio and the vertical position Yn of the starting point, calculate the starting ordinate of each UI element in the display report;
所述展示报表的右上角为坐标原点,水平向右为X轴正向,竖直向下为Y轴正向。The upper right corner of the displayed report is the coordinate origin, the horizontal direction to the right is the positive direction of the X axis, and the vertical direction is the positive direction of the Y axis.
所述绘制模块206具体用于:The drawing module 206 is specifically used for:
根据所述样式报表的页面尺寸和所述尺寸比例计算展示报表的页面尺寸;calculating the page size of the display report according to the page size of the style report and the size ratio;
根据展示报表的页面尺寸、各个UI元素在展示报表的起点横坐标、各个UI元素在展示报表的起点纵坐标、各个UI元素在展示报表的宽度和各个UI元素在展示报表的高度绘制展示报表。Draw the display report according to the page size of the display report, the abscissa of the starting point of each UI element in the display report, the vertical coordinate of the starting point of each UI element in the display report, the width of each UI element in the display report, and the height of each UI element in the display report.
本发明提供的一种报表UI元素自适应展示的系统,通过一套样式报表,根据移动终端分辨率的不同绘制与之相适应的展示报表,一套样式报表的各个UI元素在不同分辨率的移动终端能够自适应展示,不会变形。A system for self-adaptive display of report UI elements provided by the present invention uses a set of style reports to draw corresponding display reports according to different resolutions of mobile terminals. The mobile terminal can display adaptively without deformation.
以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求的保护范围为准。The above is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of changes or modifications within the technical scope disclosed in the present invention. Replacement should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610547992.9A CN107608670B (en) | 2016-07-12 | 2016-07-12 | A method and system for self-adaptive display of report UI elements |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610547992.9A CN107608670B (en) | 2016-07-12 | 2016-07-12 | A method and system for self-adaptive display of report UI elements |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN107608670A true CN107608670A (en) | 2018-01-19 |
| CN107608670B CN107608670B (en) | 2020-12-08 |
Family
ID=61055470
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610547992.9A Active CN107608670B (en) | 2016-07-12 | 2016-07-12 | A method and system for self-adaptive display of report UI elements |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN107608670B (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112269620A (en) * | 2020-11-17 | 2021-01-26 | 深圳市商汤科技有限公司 | Display method and device, electronic equipment and storage medium |
| CN112784543A (en) * | 2020-06-08 | 2021-05-11 | 北京金山办公软件股份有限公司 | Picture adjusting method, device, equipment and storage medium |
| CN115858401A (en) * | 2023-02-27 | 2023-03-28 | 成都光合信号科技有限公司 | Page detection method and device, electronic equipment and storage medium |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20130152001A1 (en) * | 2011-12-09 | 2013-06-13 | Microsoft Corporation | Adjusting user interface elements |
| CN105046629A (en) * | 2015-08-20 | 2015-11-11 | 毛一岚 | Space positioning method based on digital codes |
| CN105069092A (en) * | 2015-08-05 | 2015-11-18 | 深圳联友科技有限公司 | Report display method, system and mobile terminal |
-
2016
- 2016-07-12 CN CN201610547992.9A patent/CN107608670B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20130152001A1 (en) * | 2011-12-09 | 2013-06-13 | Microsoft Corporation | Adjusting user interface elements |
| CN105069092A (en) * | 2015-08-05 | 2015-11-18 | 深圳联友科技有限公司 | Report display method, system and mobile terminal |
| CN105046629A (en) * | 2015-08-20 | 2015-11-11 | 毛一岚 | Space positioning method based on digital codes |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112784543A (en) * | 2020-06-08 | 2021-05-11 | 北京金山办公软件股份有限公司 | Picture adjusting method, device, equipment and storage medium |
| CN112269620A (en) * | 2020-11-17 | 2021-01-26 | 深圳市商汤科技有限公司 | Display method and device, electronic equipment and storage medium |
| CN115858401A (en) * | 2023-02-27 | 2023-03-28 | 成都光合信号科技有限公司 | Page detection method and device, electronic equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN107608670B (en) | 2020-12-08 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN103218195B (en) | The display adjusting method of application program and device | |
| CN102637198B (en) | Implementation method, device, browser and mobile terminal for displaying web page content | |
| CN104035664A (en) | Display method and device for user interface of application program | |
| US20140068495A1 (en) | Apparatus and method for processing handwriting input | |
| CN101303849B (en) | Method and apparatus for rapidly displaying lapped arbitrary shape rarefaction pattern without twinkling | |
| CN104182167A (en) | Display device, display device operation method and information display system | |
| CN107608670A (en) | The method and system that a kind of form UI elements are adaptively shown | |
| CN103400565B (en) | A kind of interface piecemeal method for refreshing based on GDI | |
| CN105741819B (en) | Layer processing method and device | |
| US20130162562A1 (en) | Information processing device and non-transitory recording medium storing program | |
| CN107589989A (en) | Display device based on android platform and image display method thereof | |
| JP2009193308A (en) | Information display device and program | |
| US20160216839A1 (en) | Display device and electronic device including the same | |
| CN105760177A (en) | Control text arrangement and display method and device applicable to Mac system | |
| CN105808236B (en) | HMI picture element composition design and code generation method | |
| US20130155098A1 (en) | Adjusting Fonts for Visual Consistency | |
| CN108133094A (en) | For placement-and-routing's display methods of the field programmable gate array of antifuse | |
| JP2012098951A (en) | Graphic drawing processing apparatus, graphic drawing processing method and computer program | |
| CN102103590B (en) | Exclusive region dynamic addition typesetting method and system | |
| CN103186917B (en) | It is a kind of to realize the method and apparatus that view animation is shown | |
| CN102592261A (en) | Vector diagram showing method and system | |
| WO2019109231A1 (en) | Processing method for writing stroke and related device | |
| CN108073434B (en) | JS drawing control method and system | |
| CN109783548B (en) | Main data fusion visual display method and system, electronic device and storage medium | |
| CN107516334A (en) | Method, device, equipment and storage medium for displaying handwriting trace |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |