亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? moodcanvas.java

?? 借的別人的 只想在這里下點東西
?? JAVA
字號:
package at.ac.uni_linz.tk.vchat;

import java.awt.*;
import java.awt.event.*;
import java.util.*;


/**
 * Used as a graphical representance of the actual mood of the User. Allows the
 * User to change his mood by clicking on icons surrounding the avatar.
 *
 * @author      Arno Huetter
 * (C)opyright by the Institute for Computer Science, Telecooperation Department, University of Linz
 */

public class MoodCanvas extends PortraitCanvas implements MouseListener, MouseMotionListener, ActionListener {

  private static final double PORTRAIT_SCALE = 0.6;

  private ChatApplet chatApplet;
  private Image bufferImage;

  private PopupMenu moodPopup;


/**
 * Constructs the MessageEntry.
 *
 * @param chatParam      the ChatApplet which administrates the
 *                                users
 */

  public MoodCanvas(ChatApplet chatAdministratorParam) {
    super();
    portraitScale = PORTRAIT_SCALE;
    chatApplet = chatAdministratorParam;

    moodPopup = new PopupMenu();
    add(moodPopup);

    addMouseListener(this);
    addMouseMotionListener(this);
    moodPopup.addActionListener(this);
  }


/**
 * Sets the image that will be displayed in the MoodCanvas'es center.
 *
 * @param portraitImage      the image to be displayed
 */

  public void setImage(Image portraitImage) {
    image = portraitImage;
  }


/**
 * Paints the MoodCanvas.
 *
 * @param g       the graphics context
 */

  public void paint (Graphics g) {
    Graphics bufferGraphics;
    int canvasWidth, canvasHeight;

    moodPopup.removeAll();
    for (int i = 0; i < chatApplet.getCurrentUser().getNrOfMoods(); i++) {
      moodPopup.add(chatApplet.getCurrentUser().getMoodName(i));
    }

    canvasWidth = getSize().width;
    canvasHeight = getSize().height;

    if (bufferImage == null || bufferImage.getWidth(this) != canvasWidth || bufferImage.getHeight(this) != canvasHeight)
      bufferImage = createImage(canvasWidth, canvasHeight);

    bufferGraphics = bufferImage.getGraphics();
    bufferGraphics.setColor(getBackground());
    bufferGraphics.fillRect(0, 0, canvasWidth, canvasHeight);

    setImage(chatApplet.getUserAvatar(chatApplet.getCurrentUserId()));
    super.paint(bufferGraphics);

    bufferGraphics.setColor(Color.darkGray);
    bufferGraphics.drawOval(ChatRepository.ICON_DIMENSION.width / 2, ChatRepository.ICON_DIMENSION.height / 2, canvasWidth - ChatRepository.ICON_DIMENSION.width, canvasHeight - ChatRepository.ICON_DIMENSION.height);
    bufferGraphics.setColor(Color.black);

    for (int i = 0; i < chatApplet.getCurrentUser().getNrOfMoods(); i += 1) {
      bufferGraphics.drawImage(chatApplet.getMoodIcon(i), (int)(canvasWidth / 2 + Math.sin(i * 360 / chatApplet.getCurrentUser().getNrOfMoods() * Math.PI / 180) * (canvasWidth / 2 - ChatRepository.ICON_DIMENSION.width / 2)) - ChatRepository.ICON_DIMENSION.width / 2, (int)(canvasHeight / 2 + Math.cos(i * 360 / chatApplet.getCurrentUser().getNrOfMoods() * Math.PI / 180) * (canvasHeight / 2  - ChatRepository.ICON_DIMENSION.height / 2) - ChatRepository.ICON_DIMENSION.height / 2), this);
      if (i == chatApplet.getCurrentUser().getMood()) {
        bufferGraphics.drawOval((int)(canvasWidth / 2 + Math.sin(i * 360 / chatApplet.getCurrentUser().getNrOfMoods() * Math.PI / 180) * (canvasWidth / 2 - ChatRepository.ICON_DIMENSION.width / 2)) - ChatRepository.ICON_DIMENSION.width / 2, (int)(canvasHeight / 2 + Math.cos(i * 360 / chatApplet.getCurrentUser().getNrOfMoods() * Math.PI / 180) * (canvasHeight / 2  - ChatRepository.ICON_DIMENSION.height / 2)) - ChatRepository.ICON_DIMENSION.height / 2, ChatRepository.ICON_DIMENSION.width - 1, ChatRepository.ICON_DIMENSION.height - 1);
        bufferGraphics.drawOval((int)(canvasWidth / 2 + Math.sin(i * 360 / chatApplet.getCurrentUser().getNrOfMoods() * Math.PI / 180) * (canvasWidth / 2 - ChatRepository.ICON_DIMENSION.width / 2)) - ChatRepository.ICON_DIMENSION.width / 2 + 1, (int)(canvasHeight / 2 + Math.cos(i * 360 / chatApplet.getCurrentUser().getNrOfMoods() * Math.PI / 180) * (canvasHeight / 2  - ChatRepository.ICON_DIMENSION.height / 2)) - ChatRepository.ICON_DIMENSION.height / 2 + 1, ChatRepository.ICON_DIMENSION.width - 3, ChatRepository.ICON_DIMENSION.height - 3);
      }
    }

    g.drawImage(bufferImage, 0, 0, this);

  }


/**
 * Returns the mood that is related to a certain Point in the MoodCanvas.
 *
 * @param pointParam       the Point the User clicked on
 */

  public int getMood(Point pointParam) {
    return (ChatUtil.addAngle((ChatUtil.getAngle(new Point(getSize().width / 2, getSize().height / 2), pointParam)), (90 + 360 / chatApplet.getCurrentUser().getNrOfMoods() / 2))) * chatApplet.getCurrentUser().getNrOfMoods() / 360;
  }


/**
 * Invoked when the mouse has been clicked on a component.
 *
 * @param event      the MouseEvent
 */

  public void mouseClicked(MouseEvent event) {
  }


/**
 * Invoked when the mouse enters a component.
 *
 * @param event      the MouseEvent
 */

  public void mouseEntered(MouseEvent event) {
  }


/**
 * Invoked when the mouse exits a component.
 *
 * @param event      the MouseEvent
 */

  public void mouseExited(MouseEvent event) {
  }


/**
 * Invoked when a mouse button has been pressed on a component.
 *
 * @param event      the MouseEvent
 */

  public void mousePressed(MouseEvent event) {
    if (!event.isMetaDown() && getMood(event.getPoint()) != chatApplet.getCurrentUser().getMood()) {
      chatApplet.setUserMood(chatApplet.getCurrentUser().getId(), getMood(event.getPoint()), true);
    }
  }


/**
 * Invoked when a mouse button has been released on a component.
 *
 * @param event      the MouseEvent
 */

  public void mouseReleased(MouseEvent event) {
    if (event.isMetaDown())
      moodPopup.show(this, event.getX(), event.getY());
    else if (getMood(event.getPoint()) != chatApplet.getCurrentUser().getMood())
      chatApplet.setUserMood(chatApplet.getCurrentUser().getId(), getMood(event.getPoint()), true);
  }


/**
 * Invoked when a mouse button is pressed on a component and then dragged.
 *
 * @param event      the MouseEvent
 */

  public void mouseDragged(MouseEvent event) {
    if (!event.isMetaDown() && getMood(event.getPoint()) != chatApplet.getCurrentUser().getMood()) {
      chatApplet.setUserMood(chatApplet.getCurrentUser().getId(), getMood(event.getPoint()), true);
    }
  }


/**
 * Invoked when the mouse button has been moved on a component.
 *
 * @param event      the MouseEvent
 */

  public void mouseMoved(MouseEvent event) {
  }


/**
 * Invoked when an action occurs.
 *
 * @param event       the ActionEvent
 */
  public void actionPerformed(ActionEvent event) {

    if (event.getSource() == moodPopup) {
      for (int i = 0; i < moodPopup.getItemCount(); i++) {
        if (moodPopup.getItem(i).getLabel().equals(event.getActionCommand()))
          chatApplet.setUserMood(chatApplet.getCurrentUserId(), i, chatApplet.isConnected());
      }
    }
  }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产区在线观看成人精品| 精品国产欧美一区二区| 国产成人综合在线观看| 蜜桃av噜噜一区二区三区小说| 亚洲综合小说图片| 亚洲精品伦理在线| 亚洲精选视频免费看| 亚洲香肠在线观看| 性做久久久久久久免费看| 午夜精品久久久久影视| 日韩精品1区2区3区| 麻豆精品一二三| 精品午夜久久福利影院| 国产精品一区二区不卡| 成人蜜臀av电影| 一本到不卡免费一区二区| 欧美天堂一区二区三区| 91精品国产福利| 精品国产91亚洲一区二区三区婷婷| 久久人人97超碰com| 国产精品久久久一区麻豆最新章节| 国产精品久久久久影院色老大| 亚洲另类春色国产| 日韩电影免费在线看| 国产自产2019最新不卡| 91在线视频在线| 欧美日韩高清一区二区不卡| 精品国产亚洲在线| 自拍偷拍国产亚洲| 爽好久久久欧美精品| 国产乱码精品一区二区三区av | 欧美极品美女视频| 国产精品全国免费观看高清 | 欧美日韩成人在线| 精品少妇一区二区三区在线视频| 国产亚洲综合在线| 亚洲国产裸拍裸体视频在线观看乱了| 日本中文一区二区三区| av一二三不卡影片| 91精品国产综合久久小美女| 国产欧美一区二区精品性色| 亚洲一区成人在线| 国产aⅴ精品一区二区三区色成熟| 色欲综合视频天天天| 欧美mv日韩mv国产| 亚洲第一在线综合网站| 成人h精品动漫一区二区三区| 91 com成人网| 亚洲一区在线看| 成人小视频在线观看| 日韩欧美中文一区二区| 亚洲日穴在线视频| 国产激情91久久精品导航| 欧美日韩免费一区二区三区 | 欧美日本乱大交xxxxx| 亚洲国产精品成人综合| 午夜精品一区二区三区免费视频| jiyouzz国产精品久久| 久久综合色婷婷| 麻豆国产一区二区| 欧美日韩在线三级| 中文字幕佐山爱一区二区免费| 国产美女在线精品| 欧美成人aa大片| 日本成人中文字幕在线视频| 欧美亚洲动漫精品| 亚洲宅男天堂在线观看无病毒| 成人黄色a**站在线观看| 国产亚洲欧洲一区高清在线观看| 人人狠狠综合久久亚洲| 在线不卡一区二区| 香蕉久久夜色精品国产使用方法| 色综合欧美在线视频区| 最新不卡av在线| 99久久国产综合精品色伊| 国产欧美精品一区aⅴ影院| 国产精品中文欧美| 久久精品亚洲精品国产欧美kt∨| 国产又黄又大久久| 久久久久97国产精华液好用吗| 精品一区二区免费看| 久久久亚洲国产美女国产盗摄 | 中文字幕一区二区三中文字幕| 国产精品99久久久久久似苏梦涵| 精品国产一区二区三区忘忧草| 国产麻豆一精品一av一免费 | 91亚洲精品乱码久久久久久蜜桃| 国产精品麻豆视频| 972aa.com艺术欧美| 夜夜嗨av一区二区三区| 欧美日韩国产一级二级| 日本欧美韩国一区三区| 精品电影一区二区三区| 成人av免费观看| 亚洲在线观看免费| 3atv一区二区三区| 久久99久久久欧美国产| 久久日韩精品一区二区五区| 丰满岳乱妇一区二区三区| 亚洲狠狠丁香婷婷综合久久久| 欧美日韩成人综合在线一区二区| 黑人精品欧美一区二区蜜桃| 国产精品视频线看| 在线欧美日韩精品| 日韩国产精品久久久| 国产片一区二区三区| 欧美婷婷六月丁香综合色| 久久av老司机精品网站导航| 亚洲欧洲日韩在线| 在线播放日韩导航| 成人美女视频在线看| 亚洲小说春色综合另类电影| 久久午夜国产精品| 在线国产电影不卡| 久久国产剧场电影| 一区二区不卡在线视频 午夜欧美不卡在| 欧美艳星brazzers| 国产成人在线免费| 日韩精品一二三四| 亚洲日本一区二区三区| 欧美成人一区二区三区在线观看| 99久久综合色| 国产一区二区三区电影在线观看 | 亚洲欧洲综合另类| 日韩欧美国产wwwww| 91丨porny丨蝌蚪视频| 国内久久精品视频| 午夜精品在线看| 亚洲激情网站免费观看| 国产免费久久精品| 日韩欧美三级在线| 欧美日韩在线免费视频| 91麻豆免费看| 成人av在线网| 国产mv日韩mv欧美| 国产一区二区0| 精品一区二区久久久| 日本视频在线一区| 午夜欧美电影在线观看| 亚洲精品大片www| 亚洲视频一二三| 国产精品久久精品日日| 国产亚洲va综合人人澡精品| 日韩三级在线观看| 日韩一区二区高清| 91精品国产福利| 日韩午夜激情av| 日韩色视频在线观看| 欧美不卡一区二区三区四区| 91精品国产色综合久久ai换脸 | 奇米精品一区二区三区在线观看| 曰韩精品一区二区| 亚洲一区二区视频在线观看| 亚洲欧洲制服丝袜| 亚洲综合在线免费观看| 亚洲女人的天堂| 一区二区在线电影| 亚洲午夜久久久久久久久电影院| 亚洲一区二区在线免费看| 亚洲韩国精品一区| 亚洲123区在线观看| 青娱乐精品视频在线| 美洲天堂一区二卡三卡四卡视频| 亚洲a一区二区| 男男视频亚洲欧美| 国产在线播精品第三| 成人免费av资源| 日本精品一区二区三区高清 | 国产女同互慰高潮91漫画| 亚洲国产高清在线观看视频| 国产精品每日更新| 亚洲黄一区二区三区| 日韩不卡在线观看日韩不卡视频| 免费看日韩精品| 国产福利一区在线| 91视频免费观看| 欧美一区二区免费| 久久精品在线免费观看| 亚洲特黄一级片| 午夜欧美视频在线观看| 久久国产精品区| 99精品视频在线免费观看| 在线观看日韩电影| 精品免费国产二区三区 | 911精品产国品一二三产区| 日韩欧美卡一卡二| 国产精品久久久久久久久图文区 | 日韩国产在线一| 国产一区二区91| 欧美日韩一区二区三区免费看| 精品电影一区二区| 一级女性全黄久久生活片免费| 日韩激情视频在线观看| 成人免费高清在线观看| 欧美狂野另类xxxxoooo| 国产精品理论片| 久久国产剧场电影| 欧美日韩美少妇| 国产精品免费看片| 九九九精品视频|