久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <tfoot id='Kw47i'></tfoot>
    1. <legend id='Kw47i'><style id='Kw47i'><dir id='Kw47i'><q id='Kw47i'></q></dir></style></legend>
        <bdo id='Kw47i'></bdo><ul id='Kw47i'></ul>
    2. <small id='Kw47i'></small><noframes id='Kw47i'>

      1. <i id='Kw47i'><tr id='Kw47i'><dt id='Kw47i'><q id='Kw47i'><span id='Kw47i'><b id='Kw47i'><form id='Kw47i'><ins id='Kw47i'></ins><ul id='Kw47i'></ul><sub id='Kw47i'></sub></form><legend id='Kw47i'></legend><bdo id='Kw47i'><pre id='Kw47i'><center id='Kw47i'></center></pre></bdo></b><th id='Kw47i'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Kw47i'><tfoot id='Kw47i'></tfoot><dl id='Kw47i'><fieldset id='Kw47i'></fieldset></dl></div>

        將事件轉(zhuǎn)發(fā)到所有組件 JAVA

        Forward event to all components JAVA(將事件轉(zhuǎn)發(fā)到所有組件 JAVA)

            <bdo id='g6Fgx'></bdo><ul id='g6Fgx'></ul>
            • <small id='g6Fgx'></small><noframes id='g6Fgx'>

                <tfoot id='g6Fgx'></tfoot>

                <legend id='g6Fgx'><style id='g6Fgx'><dir id='g6Fgx'><q id='g6Fgx'></q></dir></style></legend>
                <i id='g6Fgx'><tr id='g6Fgx'><dt id='g6Fgx'><q id='g6Fgx'><span id='g6Fgx'><b id='g6Fgx'><form id='g6Fgx'><ins id='g6Fgx'></ins><ul id='g6Fgx'></ul><sub id='g6Fgx'></sub></form><legend id='g6Fgx'></legend><bdo id='g6Fgx'><pre id='g6Fgx'><center id='g6Fgx'></center></pre></bdo></b><th id='g6Fgx'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='g6Fgx'><tfoot id='g6Fgx'></tfoot><dl id='g6Fgx'><fieldset id='g6Fgx'></fieldset></dl></div>

                    <tbody id='g6Fgx'></tbody>
                • 本文介紹了將事件轉(zhuǎn)發(fā)到所有組件 JAVA的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我不知道如何解決這個(gè)問題.我正在開發(fā)一個(gè)圖形編輯器,可以在其中繪制弧(線).我手動(dòng)將弧組件的大小設(shè)置為 1000x1000,因此當(dāng)拖動(dòng)此弧時(shí)我不必更改它&掉了.然后我將所需尺寸的弧線繪制到該組件中.每個(gè)弧組件都安裝了鼠標(biāo)監(jiān)聽器.問題是,只有最上面的弧組件才能獲得鼠標(biāo)消息.我還在 JPane 本身上安裝了一個(gè)鼠標(biāo)單擊偵聽器,但是最上面的組件上的鼠標(biāo)單擊偵聽器只會(huì)獲取所有事件...很難描述這個(gè)問題,所以我將為您提供簡單的圖像

                  i dont how to solve this problem. I am developing a graphical editor, where arc(line) drawing is possible. I manually set the size of arc component to 1000x1000, so i dont have to change it when this arc will be dragged & dropped. Then i paint into this component the arc of the desired dimensions. Every arc components have mouse listener installed. The problem is, that only the most upper arc component get the mouse message. Also i have a mouse click listener installed on the JPane itself, but the mouse click listener on the most upper component simply gets all the events...It is kinda hard to describe this problem, so i will provide you with the simple image

                  所以第一個(gè)解決方案是以某種方式將收到的消息轉(zhuǎn)發(fā)到下面的組件,但是我不知道該怎么做,所以你有什么想法嗎?

                  So the first solution is to somehow forward the received message to the component that lies under, however i dont know how to do this, so do you have any ideas ?

                  第二種解決方案是,不要為弧對象設(shè)置恒定尺寸,而是以某種方式旋轉(zhuǎn)該弧所在的矩形,我的意思是這樣.

                  The second solution is, not to set constant dimenstion to the arc object, but somehow rotate the rectangle in which that arc will be, i mean it like this.

                  但是,仍然可能存在重疊問題.

                  however, there still can be the overlapping problem.

                  那么,您對如何解決這個(gè)問題有任何想法嗎?或者如果您有任何其他想法,如何解決這個(gè)問題,我很高興,我只需要正確的弧線會(huì)對鼠標(biāo)點(diǎn)擊做出反應(yīng).

                  So, do you have any ideas how to solve this problem ? or if you have any other ideas, how to solve this, id be happy, i simply need that the correct arc will react to the mouse click.

                  我不認(rèn)為我的代碼會(huì)有所幫助,但在這里

                  I dont think that the my code will somehow helps, but here it is

                  arcObject.setSize(1000, 1000); // !
                  

                  然后,在這個(gè)組件中,我畫了一個(gè)圓弧

                  and then, in this component i draw an arc

                  toX = o2.x - 24 * Math.cos(theta);
                  toY = o2.y - 24 * Math.sin(theta);
                  g2.draw(new Line2D.Double(toX, toY, o1.x, o1.y));
                  

                  推薦答案

                  我是這樣解決的:

                  1. 將所有創(chuàng)建的弧保存到列表中
                  2. 當(dāng)鼠標(biāo)點(diǎn)擊時(shí),循環(huán)遍歷所有弧線
                  3. 創(chuàng)建新的 Line2D 對象,將圓弧的參數(shù)保存在列表中,如下所示:

                  1. save all created arcs to the List
                  2. when mouse clicked, loop through all the arcs
                  3. create new Line2D object, with the parameters of the arc saved in the list, like this:

                  Line2D 線 = 新 Line2D.Double(...)

                  Line2D line = new Line2D.Double(...)

                  檢查這個(gè)條件

                  if (line.ptLineDist(x, y) < 3) {...//我們點(diǎn)擊了就行了,做點(diǎn)什么

                  if (line.ptLineDist(x, y) < 3) { ... //we clicked on the line, do something

                  }

                  這篇關(guān)于將事件轉(zhuǎn)發(fā)到所有組件 JAVA的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數(shù)溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關(guān)系嗎?)
                  How to convert Integer to int?(如何將整數(shù)轉(zhuǎn)換為整數(shù)?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內(nèi)創(chuàng)建一個(gè)隨機(jī)打亂數(shù)字的 int 數(shù)組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠?qū)?0xff000000 存儲(chǔ)為 int?)

                  • <legend id='KH2Pu'><style id='KH2Pu'><dir id='KH2Pu'><q id='KH2Pu'></q></dir></style></legend>
                      <tfoot id='KH2Pu'></tfoot>
                        <tbody id='KH2Pu'></tbody>
                      • <bdo id='KH2Pu'></bdo><ul id='KH2Pu'></ul>

                        <small id='KH2Pu'></small><noframes id='KH2Pu'>

                        <i id='KH2Pu'><tr id='KH2Pu'><dt id='KH2Pu'><q id='KH2Pu'><span id='KH2Pu'><b id='KH2Pu'><form id='KH2Pu'><ins id='KH2Pu'></ins><ul id='KH2Pu'></ul><sub id='KH2Pu'></sub></form><legend id='KH2Pu'></legend><bdo id='KH2Pu'><pre id='KH2Pu'><center id='KH2Pu'></center></pre></bdo></b><th id='KH2Pu'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='KH2Pu'><tfoot id='KH2Pu'></tfoot><dl id='KH2Pu'><fieldset id='KH2Pu'></fieldset></dl></div>

                            主站蜘蛛池模板: 一区二区在线 | 国产日韩欧美二区 | 久久久久久综合 | av一区二区在线观看 | 国产xxxx在线 | av一区二区三区 | 国产成人99久久亚洲综合精品 | 紧缚调教一区二区三区视频 | 国产乱码精品一区二区三区忘忧草 | 九九国产在线观看 | 亚洲国产精品99久久久久久久久 | 99re视频在线免费观看 | 一区二区激情 | 亚洲成a人片| 免费一级黄色录像 | 毛片视频网址 | 日韩成人在线免费视频 | 亚洲精品中文字幕中文字幕 | 成人av网站在线观看 | 福利成人 | 亚洲视频精品 | 国产精久久久久久久妇剪断 | 男女午夜激情视频 | 欧美精品一区二区在线观看 | 午夜天堂精品久久久久 | 亚洲一区二区三区四区在线观看 | 精品一区二区电影 | 亚洲欧美日韩在线不卡 | 精品一二区 | 国产在线精品一区二区 | 97精品超碰一区二区三区 | 欧美日本一区二区 | 在线视频a | 色狠狠一区 | 久久国产精品一区二区三区 | 一区二区三区四区不卡 | 国产三区精品 | 精品美女久久久 | 国产欧美一区二区三区在线看 | 日韩在线精品强乱中文字幕 | 久久影音先锋 |