/* * PopupManagerPopup.java * * Created on May 22, 2006, 12:28 PM */ package Current.popups.PopupManager; import Current.gui.*; import Current.manage.*; import Current.manage.Popup.*; import java.awt.*; import java.awt.event.*; import org.pat.graphics.boxed.ListenString; /** * * @author pat */ public class PopupManagerPopup extends Container { private class Title extends Canvas { ListenString title; public Title() { setBackground(new Color(0,0,100)); setFont(new Font("sanserif", Font.PLAIN, 12)); title=new ListenString("More Popups",this); title.setColors(Color.white, getBackground()); title.showBorder=false; setSize((int)(2*padding+title.getWidth()), (int)(2*padding+title.getHeight())); } public void paint(Graphics gfx) { Graphics2D g=(Graphics2D) gfx; g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); title.setHorizontalCenter(getWidth()/2.0); title.setVerticalCenter(getHeight()/2.0); title.render(g); } } private class List extends DBCanvas implements MouseListener, MouseMotionListener { ListenString ls[]; // translation to scroll by int ty=0, pressed_y=0; public List() { setBackground(new Color(0,100,0)); setFont(new Font("sanserif", Font.PLAIN, 12)); updateData(); setSize(); this.addMouseListener(this); this.addMouseMotionListener(this); } public void setSize(){ int x=0,y=0,temp=0; for (int i=0; ix) x=temp; temp=(int)(ls[i].getBottom()); if (temp>y) y=temp; } setSize(x+padding,(int)(ls[ls.length-1].getBottom()+padding)); } public void paint(Graphics gfx) { Graphics2D g=(Graphics2D) gfx; g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); if (ls.length>0) { if (((ls[ls.length-1]!=null))&&(ty<-(ls[ls.length-1].getBottom()+ padding-getHeight()))) ty=-(int)(ls[ls.length-1].getBottom()+ padding-getHeight()); } if (ty>0) ty=0; for (int i=0; i