2012-12-20 76 views
1

是否可以將FocusPanel劃分爲多個分段,並讓每個分段響應不同的地理方向?而這隻在FocusPanel的邊緣?FocusPanel事件只在邊緣?

我想在整個頁面上展開FocusPanel,並且只在鼠標碰到面板邊緣時才需要mousOver響應。

回答

2

據我所知,你不能把焦點面板分成幾部分。不過,你可以模擬你自己的東西,就像這樣。

public class MyFocusPanel extends DockLayoutPanel 
{ 
     private FocusPanel f1 = new FocusPanel(); 
     private FocusPanel f2 = new FocusPanel(); 
     private FocusPanel f3= new FocusPanel(); 
     private FocusPanel f4 = new FocusPanel(); 

     public MyFocusPanel() 
     { 
      super(Unit.PX); 
      f1.addClickHandler (new ClickHandler() 
      { 
       public void OnClick() 
       { 
        onFocusPanelClick(); 
       } 
      }); 
      f2.addClickHandler (new ClickHandler() 
      { 
       public void OnClick() 
       { 
        onFocusPanelClick(); 
       } 
      }); 
      f3.addClickHandler (new ClickHandler() 
      { 
       public void OnClick() 
       { 
        onFocusPanelClick(); 
       } 
      }); 
      f4.addClickHandler (new ClickHandler() 
      { 
       public void OnClick() 
       { 
        onFocusPanelClick(); 
       } 
      }); 

      addNorth(f1, 5.0); 
      addWest(f2, 5.0); 
      addEast(f3, 5.0); 
      addWest(f4, 5.0); 
} 

現在添加小部件到這個使用add(Widget); API