// ウィンドウや、その上のGUI部品などを構築する処理 void initializeWindow() { // ウィンドウを生成(この上に各種GUI部品を配置していく) window = newWindow(50, 50, WINDOW_WIDTH, WINDOW_HEIGHT, "Radian Converter"); // 度数法での角度入力欄の上に、文字列ラベルを生成/配置 int degreeLabel = newTextLabel(10, 5, 140, 20, "度数法での角度:"); mountComponent(degreeLabel, window); // 度数法での角度入力欄を生成/配置 degreeInputField = newTextField(10, 25, 140, 30, "0.0"); mountComponent(degreeInputField, window); // ラジアンでの角度入力欄の上に、文字列ラベルを生成/配置 int radianLabel = newTextLabel(280, 5, 140, 20, "ラジアン:"); mountComponent(radianLabel, window); // ラジアンでの角度入力欄を生成/配置 radianInputField = newTextField(280, 25, 140, 30, "0.0"); mountComponent(radianInputField, window); // ラジアンでの角度入力欄の下に、何πラジアンかを表示するラベルを生成/配置 radianOverPiLabel = newTextLabel(280, 55, 140, 15, "(0.0 π)"); mountComponent(radianOverPiLabel, window); // 度数法からラジアンへの変換ボタンを生成/配置 degreeToRadianButton = newButton(190, 10, 50, 30, ">>"); mountComponent(degreeToRadianButton, window); // ラジアンから度数法への変換ボタンを生成/配置 radianToDegreeButton = newButton(190, 40, 50, 30, "<<"); mountComponent(radianToDegreeButton, window); // 角度ディスプレイ用の2D描画エンジンやグラフィックスリソースを生成 displayGraphics = newGraphics(); displayRenderer = newGraphics2DRenderer(DISPLAY_WIDTH, DISPLAY_HEIGHT, displayGraphics); // 角度ディスプレイの表示ラベルを生成/配置 displayLabel = newImageLabel(0, DISPLAY_Y, DISPLAY_WIDTH, DISPLAY_HEIGHT, displayGraphics); mountComponent(displayLabel, window); // 角度スライダーを生成/配置 angleSlider = newHorizontalSlider(10, DISPLAY_Y + DISPLAY_HEIGHT + 10, WINDOW_WIDTH - 35, 30, 0, 0, 360); mountComponent(angleSlider, window); }