Đang chuẩn bị liên kết để tải về tài liệu:
Professional Eclipse 3 for Java Developers 2006 phần 10

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Bàn làm việc gọi createPartControl () khi xem được khởi tạo. Ở đây, trước tiên bạn phải tạo một Canvas, thiết lập màu nền của nó, và gán một phím để giúp tình huống nhạy cảm với nó. Giao diện HexHelpConstants được liệt kê ở đây. Sau đó, bạn cần phải tạo ra các trường hợp của các hành động được định nghĩa trước đây | Project 4 The Hex Game as a Rich Client Application The workbench invokes the createPartControl method when the view is initialized. Here you must first create a Canvas set its background color and assign a key for context-sensitive help to it. The HexHelpConstants interface is listed here. Then you need to create instances of the actions defined previously and to add these actions as tool buttons to the title bar of the view. Finally you must create an instance of the game engine and configure it and then you start the first game. Constructs the view content public void createPartControl Composite parent canvas new Canvas parent SWT.NO_BACKGROUND canvas.setBackground parent.getDisplay .getSystemColor SWT.CoLoR_GRaY WorkbenchHelp.setHelp canvas HexHelpConstants.HELP_BOARD makeActions contributeToActionBars game new Game game.setStatusListener this game.setDrawingSurface canvas game.newGame When you create a single action its identification the display label a tool tip and a key for the contextsensitive help are specified to construct the instance. The actions for color and level selection are constructed as toggle actions the others as normal actions. Create actions private void makeActions newGameAction createAction NEWGAME_ACTION New Game Starts new game HexHelpConstants.HELP_NEWGAME_ACTION whiteAction createToggleAction WHITE_ACTION White Player plays white HexHelpConstants.HELP_COLOR_ACTION true blackAction createToggleAction BLACK_ACTION Black Player plays black HexHelpConstants.HELP_COLOR_ACTION false basicAction createToggleAction BASIC_ACTION Basic Basic Level HexHelpConstants.HELP_LEVEL_ACTION true advancedAction createToggleAction ADVANCED_ACTION Advanced Advanced Level HexHelpConstants.HELP_LEVEL_ACTION false helpAction createAction HELP_ACTION Help Help for Hex null Create single action @param id - Identification 523 Chapter 15 param label - Display label param tip - Tooltip param helpId - ID for context sensitive help return - the created action .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.