!185 delete useless code

Merge pull request !185 from Faith/master
This commit is contained in:
openharmony_ci 2022-03-28 03:36:31 +00:00 committed by Gitee
commit 237b504d1e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 4 additions and 128 deletions

View File

@ -119,58 +119,12 @@ public class DistributedDataPane extends JBPanel {
private class MyTabPanel extends JBTabbedPane implements MouseListener {
private Rectangle setting = new Rectangle();
private Rectangle cancel = new Rectangle();
// private Point startPoint;
// private Point endPoint;
// private Rectangle srcBounds;
/**
* MyTabPanel
*/
public MyTabPanel() {
addMouseListener(this);
// addMouseMotionListener(new MouseMotionListener() {
// @Override
// public void mouseDragged(MouseEvent event) {
// if (getCursor().getType() == Cursor.N_RESIZE_CURSOR) {
// endPoint = SwingUtilities.convertPoint(MyTabPanel.this, event.getPoint(),
// MyTabPanel.this.getRootPane().getLayeredPane());
// int yPosition = Utils.getY(endPoint) - Utils.getY(startPoint);
// if (srcBounds.height - yPosition < barHeight) {
// return;
// } else if (srcBounds.height - yPosition
// > MyTabPanel.this.getRootPane().getLayeredPane().getHeight() - barHeight) {
// return;
// } else {
// DistributedDataPane.this.setBounds(Utils.getX(srcBounds),
// Utils.getY(srcBounds) + yPosition,
// srcBounds.width,
// srcBounds.height - yPosition);
// DistributedDataPane.this.revalidate();
// if (boundsChangeListener != null) {
// boundsChangeListener.consume(DistributedDataPane.this.getBounds());
// }
// }
// }
// }
//
// @Override
// public void mouseMoved(MouseEvent event) {
// int xNum = 0;
// if (getTabCount() > 0) {
// Rectangle rect = getUI().getTabBounds(MyTabPanel.this, getTabCount() - 1);
// xNum = rect.width + Utils.getX(rect) + 10;
// }
// if (event.getY() > 0 && event.getY() < barHeight && event.getX() > xNum) {
// if (setting.contains(event.getPoint()) || cancel.contains(event.getPoint())) {
// setCursor(new Cursor(Cursor.HAND_CURSOR));
// } else {
// setCursor(new Cursor(Cursor.N_RESIZE_CURSOR));
// }
// } else {
// setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
// }
// }
// });
}
@Override
@ -207,9 +161,6 @@ public class DistributedDataPane extends JBPanel {
@Override
public void mousePressed(MouseEvent event) {
// srcBounds = DistributedDataPane.this.getBounds()
// startPoint = SwingUtilities
// .convertPoint(MyTabPanel.this, event.getPoint(), MyTabPanel.this.getRootPane().getLayeredPane())
}
@Override

View File

@ -395,7 +395,6 @@ public class DistributedTimeShaft extends JBPanel implements KeyListener, MouseL
g2.fillRect(0, 0, getWidth(), getHeight());
g2.setComposite(alpha100);
g2.setColor(JBColor.foreground());
// g2.drawString("CPU Usage", 3, 13);
g2.setComposite(alpha100);
if (startX == 0 && endX == 0) {
startX = 0;

View File

@ -73,12 +73,6 @@ class AppTracePanelTest {
delay(10000);
mouseClick(317, 373);
select(494, 367, 584, 467);
// select(419, 369, 500, 469);
// mouseClick(1290, 96);
// mouseClick(315, 535);
// mouseClick(1290, 96);
// mouseClick(52, 437);
// mouseClick(1386, 97);
delay();
}

View File

@ -68,7 +68,6 @@ class DistributedDataStatisticsPaneTest {
frame = new FrameFixture(jFrame);
frame.show(new Dimension(1024, 600));
frame.moveTo(new Point(0, 0));
// inspect();
}
@AfterEach
@ -100,7 +99,6 @@ class DistributedDataStatisticsPaneTest {
mouseClick(312, 64);
mouseClick(290, 158);
mouseClick(390, 68);
// inspect();
delay();
}

View File

@ -80,7 +80,6 @@ class DistributedPanelTest {
.setOffsetB(186590530788000L)
.build());
panel.updateUI();
// inspect();
delay(10000);
select(280, 90, 285, 90); // 测试选择时间区间
keyClick(KeyEvent.VK_W); // 测试 wsad 缩放
@ -88,10 +87,6 @@ class DistributedPanelTest {
keyClick(KeyEvent.VK_A);
keyClick(KeyEvent.VK_D);
mouseClick(23, 234); // 展开thread
// mouseClick(43, 234);//选中thread
// select(300, 234,400, 236);//选中thread范围
// mouseClick(300, 234);//取消选中thread
// mouseClick(430, 234);//点击func
delay();
}

View File

@ -630,7 +630,6 @@ class AnalystPanelTest {
AnalystPanel analystPanel = new AnalystPanel();
JFrame jbPanel = new JFrame();
jbPanel.add(analystPanel);
// AnalystPanel.layeredPane = jbPanel.getLayeredPane();
FlagBean flagBean = new FlagBean();
flagBean.setColor(Color.BLACK);
flagBean.setTime(1L);
@ -643,7 +642,6 @@ class AnalystPanelTest {
AnalystPanel analystPanel = new AnalystPanel();
JFrame jbPanel = new JFrame();
jbPanel.add(analystPanel);
// AnalystPanel.layeredPane = jbPanel.getLayeredPane();
FlagBean flagBean = new FlagBean();
flagBean.setColor(Color.BLACK);
flagBean.setTime(0L);
@ -668,7 +666,6 @@ class AnalystPanelTest {
AnalystPanel analystPanel = new AnalystPanel();
JFrame jbPanel = new JFrame();
jbPanel.add(analystPanel);
// AnalystPanel.layeredPane = jbPanel.getLayeredPane();
FlagBean flagBean = new FlagBean();
flagBean.setColor(Color.BLACK);
flagBean.setTime(-1000L);
@ -681,7 +678,6 @@ class AnalystPanelTest {
AnalystPanel analystPanel = new AnalystPanel();
JFrame jbPanel = new JFrame();
jbPanel.add(analystPanel);
// AnalystPanel.layeredPane = jbPanel.getLayeredPane();
FlagBean flagBean = new FlagBean();
flagBean.setColor(Color.BLACK);
flagBean.setTime(Long.MAX_VALUE);

View File

@ -1,57 +0,0 @@
// /*
// * Copyright (c) 2021 Huawei Device Co., Ltd.
// * Licensed under the Apache License, Version 2.0 (the "License");
// * you may not use this file except in compliance with the License.
// * You may obtain a copy of the License at
// *
// * http://www.apache.org/licenses/LICENSE-2.0
// *
// * Unless required by applicable law or agreed to in writing, software
// * distributed under the License is distributed on an "AS IS" BASIS,
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// * See the License for the specific language governing permissions and
// * limitations under the License.
// */
//
// package ohos.devtools.views.trace.component;
//
// import org.junit.jupiter.api.Test;
//
// import java.awt.event.MouseEvent;
//
// /**
// * test TabPanel class .
// *
// * @version 1.0
// * @date 2021/4/24 18:03
// **/
// class TabPanelTest {
// /**
// * test function the mouseDragged .
// */
// @Test
// void mouseDragged() {
// TabPanel tabPanel = new TabPanel();
// MouseEvent mouseEvent = new MouseEvent(tabPanel, 1, 1, 1, 1, 1, 1, true, 1);
// tabPanel.mouseDragged(mouseEvent);
// }
//
// /**
// * test function the mouseMoved .
// */
// @Test
// void mouseMoved() {
// TabPanel tabPanel = new TabPanel();
// MouseEvent mouseEvent = new MouseEvent(tabPanel, 1, 1, 1, 1, 1, 1, true, 1);
// tabPanel.mouseMoved(mouseEvent);
// }
//
// /**
// * test function the hideInBottom .
// */
// @Test
// void hideInBottom() {
// TabPanel tabPanel = new TabPanel();
// tabPanel.hideInBottom();
// }
// }