Skip to content

Commit

Permalink
2021-03-05
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgramTraveler committed Mar 5, 2021
1 parent 1f4deb5 commit 5b1068e
Show file tree
Hide file tree
Showing 28 changed files with 184 additions and 94 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -810,3 +810,17 @@
* 对增量化概念的细分和调整,增加时间范围检测,和实例化产生差别

---

### 2021-03-05

### 对增量化模式的修改

* 修改捕获压力的时间间隔,和其他模式的时间间隔做出区分
* 在该模式下,记录笔的信息的值改为当提示信息第一次出现的时候记录当前的值
* 对达到增量化的条件做出修改

### 实列化模式的数据记录

* 实例化模式的数据记录为在画线过程中所有点数据的平均值

---
Binary file modified README.pdf
Binary file not shown.
17 changes: 6 additions & 11 deletions information.csv
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
����,ʵ������,һ��ʵ�����,ģʽ�л�����,Ŀ����ɫ,Ŀ���ϸ,��ʼʱ��,����ʱ��,��ɫ�л�ʱ��,�����л�ʱ��,ģʽ�л���ʱ��,��������ʱ��,��һ�λ���ʱ��,�ڶ��λ���ʱ��,�����λ���ʱ��,�󴥷�����,��ɫ�л�������,�����л�������,ģʽ�л��ܴ�����,ѹ��1,ѹ��2,��λ��1,��λ��2,��б��1,��б��2,
,1,1,��ͳ����ģʽ,��ɫ,4.0,11:39:17:851,11:39:19:26,-1614829158351,-1931,-1614829160282,1957,615,417,426,1,1,1,2,0,0,0,0,0,0,
,1,2,��ͳ����ģʽ,��ɫ,4.0,11:39:17:851,11:39:19:26,-3036,-1903,-4939,2051,905,440,306,3,1,0,3,0,0,0,0,0,0,
,1,1,��ͳ����ģʽ,��ɫ,4.0,11:41:45:851,11:41:46:755,-1800,-1138,-2938,1301,440,347,260,2,1,1,2,0,0,0,0,0,0,
,1,2,��ͳ����ģʽ,��ɫ,2.0,11:41:45:851,11:41:46:755,-6234,-1283,-7517,1323,497,322,226,1,1,1,4,0,0,0,0,0,0,
,1,1,P-ʵ��ֵ,��ɫ,2.0,11:44:04:521,11:44:10:435,-1614829452724,-1614829455499,-3229658908223,13786,5920,2490,2802,0,1,1,2,0,0,0,0,0,0,
,1,1,P-ʵ��ֵ,��ɫ,3.0,11:48:27:232,11:48:31:374,-1614829712496,-1614829715027,-3229659427523,7055,1122,360,1399,98,1,1,2,0,0,0,0,0,0,
,1,3,P-ʵ��ֵ,��ɫ,4.0,11:48:27:232,11:48:31:374,3172,-21520,-18348,8810,3709,3370,695,99,1,1,6,0,0,0,0,0,0,
,1,1,P-ʵ��ֵ,��ɫ,4.0,11:50:56:702,11:51:00:469,4789,6059,10848,10202,1027,6062,920,1,0,0,0,0,0,0,0,0,0,
,1,2,P-ʵ��ֵ,��ɫ,3.0,11:50:56:702,11:51:00:469,-38078,-38392,-76470,7450,3665,97,786,2,1,1,2,0,0,0,0,0,0,
,1,1,P-��ɢֵ,��ɫ,4.0,12:02:11:994,12:02:30:699,-1918,-6967,-8885,18709,4939,1918,6803,2,1,1,2,0,0,0,0,0,0,
����,ʵ������,һ��ʵ�����,ģʽ�л�����,Ŀ����ɫ,Ŀ���ϸ,��ʼʱ��,����ʱ��,��ɫ�л�ʱ��,�����л�ʱ��,ģʽ�л���ʱ��,��������ʱ��,��һ�λ���ʱ��,�ڶ��λ���ʱ��,�����λ���ʱ��,�󴥷�����,��ɫ�л�������,�����л�������,ģʽ�л��ܴ�����,ѹ��1,ѹ��2,ѹ��ƽ��ֵ,��λ��1,��λ��2,��λ��ƽ��ֵ,��б��1,��б��2,��б��ƽ��ֵ,
,1,1,P-ʵ��ֵ,��ɫ,3.0,11:32:51:354,11:32:59:807,1752,2403,4155,7280,2303,2406,919,0,0,1,1,0,0,339,0,0,0,0,0,0,
,1,2,P-ʵ��ֵ,��ɫ,2.0,11:32:51:354,11:32:59:807,2371,3834,6205,8200,2658,3837,552,0,0,0,1,0,0,393,0,0,0,0,0,0,
,1,3,P-ʵ��ֵ,��ɫ,4.0,11:32:51:354,11:32:59:807,1626,2710,4336,6674,1931,2716,722,0,0,0,1,0,0,387,0,0,0,0,0,0,
,1,1,P-ʵ��ֵ,��ɫ,2.0,11:39:08:273,11:39:16:135,4959,3004,7963,6812,2484,3007,616,0,0,0,0,0,0,362,0,0,0,0,0,0,
,1,1,T-ʵ��ֵ,��ɫ,2.0,12:01:40:703,12:01:53:776,4084,-1614916913165,-1614916909081,9018,5529,611,853,0,1,1,2,0,0,0,0,0,0,0,0,59,
Binary file modified out/production/PenProject/AIExperimentPanel.class
Binary file not shown.
Binary file modified out/production/PenProject/ActualAzimuth.class
Binary file not shown.
Binary file modified out/production/PenProject/ActualPress.class
Binary file not shown.
Binary file modified out/production/PenProject/ActualTilt.class
Binary file not shown.
Binary file modified out/production/PenProject/IncrementAzimuth.class
Binary file not shown.
Binary file modified out/production/PenProject/IncrementPress.class
Binary file not shown.
Binary file modified out/production/PenProject/IncrementTilt.class
Binary file not shown.
Binary file modified out/production/PenProject/PIExperimentPanel.class
Binary file not shown.
Binary file modified out/production/PenProject/PenData.class
Binary file not shown.
Binary file modified out/production/PenProject/ScatteredAzimuth.class
Binary file not shown.
Binary file modified out/production/PenProject/ScatteredPress.class
Binary file not shown.
Binary file modified out/production/PenProject/ScatteredTilt.class
Binary file not shown.
Binary file modified out/production/PenProject/TIExperimentJPanel.class
Binary file not shown.
52 changes: 33 additions & 19 deletions src/AIExperimentPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,22 +162,22 @@ public void PaintOpenMenu(Graphics2D graphics2D) {
//画出颜色和像素两个菜单
for (int i =0; i < NumberOfMenu; i ++) {
graphics2D.setColor(MenuItemColor);
graphics2D.fillRect(MenuX - MenuWidth,MenuY + (MenuHeight * i),MenuWidth,MenuHeight);
graphics2D.fillRect(MenuX,MenuY + (MenuHeight * i),MenuWidth,MenuHeight);
graphics2D.setColor(MenuLineColor);
graphics2D.drawRect(MenuX - MenuWidth,MenuY + (MenuHeight * i),MenuWidth,MenuHeight);
graphics2D.drawRect(MenuX,MenuY + (MenuHeight * i),MenuWidth,MenuHeight);
}
//设置颜色提示标签位置
ColorJLabel.setBounds(MenuX - MenuWidth + 5,MenuY,MenuWidth,MenuHeight);
ColorJLabel.setBounds(MenuX + 5,MenuY,MenuWidth,MenuHeight);
this.add(ColorJLabel); //将标签添加到组件中
//设置像素提示标签位置
PixelJLabel.setBounds(MenuX - MenuWidth + 5,MenuY + MenuHeight,MenuWidth,MenuHeight);
PixelJLabel.setBounds(MenuX + 5,MenuY + MenuHeight,MenuWidth,MenuHeight);
this.add(PixelJLabel); //将像素提示标签添加到组件中
//根据选择的菜单框中的位置来给出相应的反馈
if (SelectMenuItem >= 0) {
graphics2D.setColor(SelectMenuItemColor);
graphics2D.fillRect(MenuX - MenuWidth,MenuY + (MenuHeight * SelectMenuItem),MenuWidth,MenuHeight);
graphics2D.fillRect(MenuX,MenuY + (MenuHeight * SelectMenuItem),MenuWidth,MenuHeight);
graphics2D.setColor(MenuLineColor);
graphics2D.drawRect(MenuX - MenuWidth,MenuY + (MenuHeight * SelectMenuItem),MenuWidth,MenuHeight);
graphics2D.drawRect(MenuX,MenuY + (MenuHeight * SelectMenuItem),MenuWidth,MenuHeight);
}
//如果是在颜色区域,则打开颜色的分支菜单
if (ShowColorMenu)
Expand Down Expand Up @@ -262,24 +262,38 @@ public void PaintColorMenuItem(Graphics2D graphics2D) {
//绘制出三个颜色区域,分别存放蓝色,红色和黄色
for (int i = 0; i < NumberColor_Pixel; i ++) {
graphics2D.setColor(MenuItemColor);
graphics2D.fillRect(MenuX - MenuWidth - MenuItemWidth,MenuY + (MenuItemHeight * i),MenuItemWidth,MenuItemHeight);
graphics2D.fillRect(MenuX + MenuWidth,MenuY + (MenuItemHeight * i),MenuItemWidth,MenuItemHeight);
graphics2D.setColor(MenuLineColor);
graphics2D.drawRect(MenuX - MenuWidth - MenuItemWidth,MenuY + (MenuItemHeight * i),MenuItemWidth,MenuItemHeight);
graphics2D.drawRect(MenuX + MenuWidth,MenuY + (MenuItemHeight * i),MenuItemWidth,MenuItemHeight);
}
//设置所有颜色标签的位置
ColorBlue.setBounds(MenuX - MenuWidth - MenuItemWidth + 5,MenuY ,MenuItemWidth,MenuItemHeight);
/*ColorBlue.setBounds(MenuX + MenuWidth - MenuItemWidth + 5,MenuY ,MenuItemWidth,MenuItemHeight);
ColorRed.setBounds(MenuX - MenuWidth - MenuItemWidth + 5,MenuY + MenuItemHeight,MenuItemWidth,MenuItemHeight);
ColorYellow.setBounds(MenuX - MenuWidth - MenuItemWidth + 5,MenuY + MenuItemHeight * 2,MenuItemWidth,MenuItemHeight);
//将所有颜色标签添加到组件
this.add(ColorBlue);
this.add(ColorRed);
this.add(ColorYellow);
this.add(ColorYellow);*/
//设置红色颜色块的位置
graphics2D.setColor(Color.BLUE);
graphics2D.fillRect(MenuX + MenuWidth, MenuY, MenuItemWidth, MenuItemHeight);
//设置黄色颜色块的位置
graphics2D.setColor(Color.RED);
graphics2D.fillRect(MenuX + MenuWidth, MenuY + MenuItemHeight, MenuItemWidth, MenuItemHeight);
//设置蓝色颜色块的位置
graphics2D.setColor(Color.ORANGE);
graphics2D.fillRect(MenuX + MenuWidth, MenuY + MenuItemHeight * 2, MenuItemWidth, MenuItemHeight);
//对设置的颜色块进行描边
graphics2D.setColor(Color.BLACK);
graphics2D.drawRect(MenuX + MenuWidth, MenuY, MenuItemWidth, MenuItemHeight);
graphics2D.drawRect(MenuX + MenuWidth, MenuY + MenuItemHeight, MenuItemWidth, MenuItemHeight);
graphics2D.drawRect(MenuX + MenuWidth, MenuY + MenuItemHeight * 2, MenuItemWidth, MenuItemHeight);
//如果有颜色被选择
if (SelectColorItem >= 0) {
graphics2D.setColor(SelectMenuItemColor);
graphics2D.fillRect(MenuX - MenuWidth - MenuItemWidth,MenuY + MenuItemHeight * SelectColorItem,MenuItemWidth,MenuItemHeight);
graphics2D.fillRect(MenuX + MenuWidth,MenuY + MenuItemHeight * SelectColorItem,MenuItemWidth,MenuItemHeight);
graphics2D.setColor(MenuLineColor);
graphics2D.drawRect(MenuX - MenuWidth - MenuItemWidth,MenuY + MenuItemHeight * SelectColorItem,MenuItemWidth,MenuItemHeight);
graphics2D.drawRect(MenuX + MenuWidth,MenuY + MenuItemHeight * SelectColorItem,MenuItemWidth,MenuItemHeight);
SetColor = SelectColorItem + 1; //只有进行有效的切换时才保留颜色值
}
}
Expand All @@ -288,24 +302,24 @@ public void PaintPixelMenuItem(Graphics2D graphics2D) {
//绘制出三个像素区域,分别存放2.0,3.0和4.0
for (int i = 1; i < NumberColor_Pixel * 2 - 2; i ++) {
graphics2D.setColor(MenuItemColor);
graphics2D.fillRect(MenuX - MenuWidth - MenuItemWidth,MenuY + (MenuItemHeight * i),MenuItemWidth,MenuItemHeight);
graphics2D.fillRect(MenuX + MenuWidth,MenuY + (MenuItemHeight * i),MenuItemWidth,MenuItemHeight);
graphics2D.setColor(MenuLineColor);
graphics2D.drawRect(MenuX - MenuWidth - MenuItemWidth,MenuY + (MenuItemHeight * i),MenuItemWidth,MenuItemHeight);
graphics2D.drawRect(MenuX + MenuWidth,MenuY + (MenuItemHeight * i),MenuItemWidth,MenuItemHeight);
}
//设置所有像素标签的位置
PixelTow.setBounds(MenuX - MenuWidth - MenuItemWidth + 5,MenuY + MenuItemHeight,MenuItemWidth,MenuItemHeight);
PixelThree.setBounds(MenuX - MenuWidth - MenuItemWidth + 5,MenuY + MenuItemHeight * 2,MenuItemWidth,MenuItemHeight);
PixelFour.setBounds(MenuX - MenuWidth - MenuItemWidth + 5,MenuY + MenuItemHeight * 3,MenuItemWidth,MenuItemHeight);
PixelTow.setBounds(MenuX + MenuWidth + 5,MenuY + MenuItemHeight,MenuItemWidth,MenuItemHeight);
PixelThree.setBounds(MenuX + MenuWidth + 5,MenuY + MenuItemHeight * 2,MenuItemWidth,MenuItemHeight);
PixelFour.setBounds(MenuX + MenuWidth + 5,MenuY + MenuItemHeight * 3,MenuItemWidth,MenuItemHeight);
//将所有像素标签添加到组件中
this.add(PixelTow);
this.add(PixelThree);
this.add(PixelFour);
//如果有像素被选择
if (SelectPixelItem >= 0) {
graphics2D.setColor(SelectMenuItemColor);
graphics2D.fillRect(MenuX - MenuWidth - MenuItemWidth,MenuY + MenuItemHeight * (SelectPixelItem + 1),MenuItemWidth,MenuItemHeight);
graphics2D.fillRect(MenuX + MenuWidth,MenuY + MenuItemHeight * (SelectPixelItem + 1),MenuItemWidth,MenuItemHeight);
graphics2D.setColor(MenuLineColor);
graphics2D.drawRect(MenuX - MenuWidth - MenuItemWidth,MenuY + MenuItemHeight * (SelectPixelItem + 1),MenuItemWidth,MenuItemHeight);
graphics2D.drawRect(MenuX + MenuWidth,MenuY + MenuItemHeight * (SelectPixelItem + 1),MenuItemWidth,MenuItemHeight);
SetPixel = SelectPixelItem + 2; //只有进行有效的切换时,才保留像素值
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/ActualAzimuth.java
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,8 @@ public void mouseClicked(MouseEvent e) {
@Override
public void mousePressed(MouseEvent e) {
if (javax.swing.SwingUtilities.isLeftMouseButton(e)) {
penData.SetAzimuth(penValue.Azimuth());
penData.AddCount();
//如果要显是动态压力图像
/*if (ChooseFlag) {
timer.restart();
Expand Down Expand Up @@ -420,6 +422,8 @@ public void mouseReleased(MouseEvent e) {
aaExperimentPanel.RemoveAllJLabel(); //清除颜色和像素提示标签
aaExperimentPanel.SetSelectPixelItem(-1); //初始化像素分支选择
aaExperimentPanel.SetSelectColorItem(-1); //初始化颜色分支选择
aaExperimentPanel.SetShowColorMenu(false);
aaExperimentPanel.SetShowPixelMenu(false);
//对压力值重新获取
try {
tablet.poll();
Expand Down Expand Up @@ -627,6 +631,8 @@ else if (StringRandomP == "请切换像素为4.0") {
//更新点的起始坐标(下一个点的开始为上一个点的结束)
x0 = x1;
y0 = y1;
penData.SetAzimuth(penValue.Azimuth());
penData.AddCount();
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/ActualPress.java
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,8 @@ public void mouseClicked(MouseEvent e) {
@Override
public void mousePressed(MouseEvent e) {
if (javax.swing.SwingUtilities.isLeftMouseButton(e)) {
penData.SetPressure(penValue.Pressure());
penData.AddCount();
//如果要显是动态压力图像
/*if (ChooseFlag) {
timer.restart();
Expand Down Expand Up @@ -421,6 +423,8 @@ public void mouseReleased(MouseEvent e) {
paExperimentPanel.RemoveAllJLabel(); //清除颜色和像素提示标签
paExperimentPanel.SetSelectPixelItem(-1); //初始化像素分支选择
paExperimentPanel.SetSelectColorItem(-1); //初始化颜色分支选择
paExperimentPanel.SetShowColorMenu(false);
paExperimentPanel.SetShowPixelMenu(false);
//对压力值重新获取
try {
tablet.poll();
Expand Down Expand Up @@ -630,6 +634,8 @@ else if (StringRandomP == "请切换像素为4.0") {
//更新点的起始坐标(下一个点的开始为上一个点的结束)
x0 = x1;
y0 = y1;
penData.SetPressure(penValue.Pressure());
penData.AddCount();
}


Expand Down
6 changes: 6 additions & 0 deletions src/ActualTilt.java
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ public void mouseClicked(MouseEvent e) {
@Override
public void mousePressed(MouseEvent e) {
if (javax.swing.SwingUtilities.isLeftMouseButton(e)) {
penData.SetTilt(penValue.Tilt());
penData.AddCount();
//如果要显是动态压力图像
/*if (ChooseFlag) {
timer.restart();
Expand Down Expand Up @@ -422,6 +424,8 @@ public void mouseReleased(MouseEvent e) {
taExperimentPanel.RemoveAllJLabel(); //清除颜色和像素提示标签
taExperimentPanel.SetSelectPixelItem(-1); //初始化像素分支选择
taExperimentPanel.SetSelectColorItem(-1); //初始化颜色分支选择
taExperimentPanel.SetShowColorMenu(false);
taExperimentPanel.SetShowPixelMenu(false);
//对压力值重新获取
try {
tablet.poll();
Expand Down Expand Up @@ -632,6 +636,8 @@ else if (StringRandomP == "请切换像素为4.0") {
//更新点的起始坐标(下一个点的开始为上一个点的结束)
x0 = x1;
y0 = y1;
penData.SetTilt(penValue.Tilt());
penData.AddCount();
}
}

Expand Down
16 changes: 10 additions & 6 deletions src/IncrementAzimuth.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
purpose:方位角增量化界面,主要是通过方位角的不断变化来进行颜色和像素的选择
*/
public class IncrementAzimuth extends JFrame implements ActionListener, MouseInputListener, KeyListener {
private int time = 50;
private int time = 350;
private Timer timer = new Timer(time,this);
private AIExperimentPanel aiExperimentPanel = new AIExperimentPanel();

Expand Down Expand Up @@ -226,7 +226,7 @@ public int CheckSelectMenuItem(int x,int y) {
int MenuItem = -1;
int tempY = MenuY;
for (int i = 0; i < NumberOfMenuItem; i ++) {
if ((MenuX - MenuWith) <= x && (MenuX >= x)) {
if ((MenuX + MenuWith) >= x && (MenuX < x)) {
if ((MenuY <= y) && (tempY + MenuHeight) >= y) {
MenuItem = i;
break;
Expand All @@ -253,7 +253,7 @@ public int CheckColorItem(int x, int y) {
int ColorItem = -1;
int tempY = MenuY;
for (int i = 0; i < 3; i ++) {
if ((MenuX - MenuWith * 2) <= x && (MenuX - MenuWith >= x)) {
if ((MenuX + MenuWith * 2) >= x && (MenuX + MenuWith <= x)) {
if ((MenuY <= y) && (tempY + MenuHeight) >= y) {
ColorItem = i;
break;
Expand All @@ -268,7 +268,7 @@ public int CheckPixelItem(int x, int y) {
int PixelItem = -1;
int tempY = MenuY;
for (int i = 0; i < 3; i ++) {
if ((MenuX - MenuWith * 2) <= x && (MenuX - MenuWith >= x)) {
if ((MenuX + MenuWith * 2) >= x && (MenuX + MenuWith <= x)) {
if ((MenuY + MenuHeight<= y) && (tempY + MenuHeight * 2) >= y) {
PixelItem = i;
break;
Expand All @@ -284,7 +284,7 @@ public void actionPerformed(ActionEvent e) {
CurrentAzimuth = penValue.Azimuth(); //获得当前的方位角

//如果到达了预设的方位角范围,就打开颜色和像素选择菜单
if ((CurrentAzimuth >= 0 && CurrentAzimuth <= 55) || (CurrentAzimuth >= 205 && CurrentAzimuth <= 359)) {
if ((CurrentAzimuth >= 0 && CurrentAzimuth <= 50) || (CurrentAzimuth >= 214 && CurrentAzimuth <= 359)) {
if (ColorChange == false && PixelChange == false) {
penData.AddTouchE(); //误触发总数加一
}
Expand All @@ -299,7 +299,7 @@ public void actionPerformed(ActionEvent e) {
aiExperimentPanel.SetCurrentAzimuth(CurrentAzimuth);
aiExperimentPanel.repaint();
}
if ((CurrentAzimuth <= 110 && CurrentAzimuth > 55) || (CurrentAzimuth >= 154 && CurrentAzimuth < 205)) {
if ((CurrentAzimuth <= 110 && CurrentAzimuth > 50) || (CurrentAzimuth >= 154 && CurrentAzimuth < 214)) {
PromptFlag = true;
}else {
PromptFlag = false;
Expand Down Expand Up @@ -438,6 +438,8 @@ public void mouseReleased(MouseEvent e) {
aiExperimentPanel.RemoveAllJLabel(); //清除颜色和像素提示标签
aiExperimentPanel.SetSelectPixelItem(-1); //初始化像素分支选择
aiExperimentPanel.SetSelectColorItem(-1); //初始化颜色分支选择
aiExperimentPanel.SetShowColorMenu(false);
aiExperimentPanel.SetShowPixelMenu(false);
//对压力值重新获取
try {
tablet.poll();
Expand Down Expand Up @@ -553,6 +555,7 @@ public void mouseDragged(MouseEvent e) {
double y = dot.DotStarY();

if (x >= 583 && x < 966 && y >= 5 && y <= 105 && ColorFlag == true) {
penData.SetAzimuthC(penValue.Azimuth());
penData.AddTime(System.currentTimeMillis()); //线条绘制结束
ColorChange = true; //当进入到颜色测试区域时,颜色测换才合法
penData.SetStartColorMode(System.currentTimeMillis());
Expand Down Expand Up @@ -592,6 +595,7 @@ else if (StringRandomC == "请切换颜色为黄色") {
}

if (x0 >= 966 && x0 <= 1350 && y0 >= 5 && y0 <= 105 && PixelFlag == true) {
penData.SetAzimuthP(penValue.Azimuth());
penData.AddTime(System.currentTimeMillis()); //线条绘制结束
PixelChange = true; //当进入到像素测试区域时,此时的像素测换才合法
penData.SetStartPixelMode(System.currentTimeMillis());
Expand Down
Loading

0 comments on commit 5b1068e

Please sign in to comment.