📄 newline.java
字号:
package com.ismyway.fairyui;import javax.microedition.lcdui.Graphics;import com.ismyway.anyview.others.Settings;public class NewLine extends DisplayableBlock { private int _height; private Integer filled = null; private int strokeStyle = Graphics.SOLID; public NewLine() { this(1); } public NewLine(Integer filled) { this(1); this.filled = filled; } public NewLine(int height) { this._height = height; } public NewLine(int height, Integer filled) { this._height = height; this.filled = filled; } public NewLine(int height, Integer filled, int strokeStyle) { this._height = height; this.filled = filled; this.strokeStyle = strokeStyle; } public void paint(Graphics g, int adjustx, int adjusty) { //System.out.println("newline paint........" + (getTop() - adjusty) + ", " + getHeight()); if (null != filled) { int old = g.getStrokeStyle(); g.setStrokeStyle(strokeStyle); g.setColor(filled.intValue()); for (int i = 0; i < getHeight(); i++) { g.drawLine(getLeft(), getTop() - adjusty + i, getLeft() + getWidth(), getTop() - adjusty + i); } g.setStrokeStyle(old); //g.fillRect(getLeft(), getTop() - adjusty, getWidth(), getHeight()); } } public void putInSequence(int[] rect, int width) { //System.out.println("rect: " + rect[0] + ", " + rect[1] + ", " + rect[2] + ", " + rect[3]); // int r0 = rect[0]; int r1 = rect[1]; // int r2 = rect[2]; int r3 = rect[3]; setWidth(width); setHeight(_height); setInnerLeft(Settings.VECPADDING); setInnerTop(r1 + r3 + Settings.HORPADDING * 2); rect[0] = 0; rect[1] = r1 + r3 + Settings.HORPADDING * 4 + _height; rect[2] = width + Settings.VECPADDING; rect[3] = 1; } public void setFilled(Integer filled) { this.filled = filled; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -