604 lines
30 KiB
HTML
604 lines
30 KiB
HTML
|
<!DOCTYPE HTML>
|
||
|
<!-- NewPage -->
|
||
|
<html lang="fr">
|
||
|
<head>
|
||
|
<!-- Generated by javadoc (15) on Fri May 07 15:56:25 CEST 2021 -->
|
||
|
<title>Window</title>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
|
||
|
<meta name="dc.created" content="2021-05-07">
|
||
|
<meta name="description" content="declaration: package: battleship.view, class: Window">
|
||
|
<meta name="generator" content="javadoc/ClassWriterImpl">
|
||
|
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
|
||
|
<link rel="stylesheet" type="text/css" href="../../script-dir/jquery-ui.min.css" title="Style">
|
||
|
<link rel="stylesheet" type="text/css" href="../../jquery-ui.overrides.css" title="Style">
|
||
|
<script type="text/javascript" src="../../script.js"></script>
|
||
|
<script type="text/javascript" src="../../script-dir/jquery-3.5.1.min.js"></script>
|
||
|
<script type="text/javascript" src="../../script-dir/jquery-ui.min.js"></script>
|
||
|
</head>
|
||
|
<body class="class-declaration-page">
|
||
|
<script type="text/javascript">var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10};
|
||
|
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
|
||
|
var altColor = "alt-color";
|
||
|
var rowColor = "row-color";
|
||
|
var tableTab = "table-tab";
|
||
|
var activeTableTab = "active-table-tab";
|
||
|
var pathtoroot = "../../";
|
||
|
loadScripts(document, 'script');</script>
|
||
|
<noscript>
|
||
|
<div>JavaScript is disabled on your browser.</div>
|
||
|
</noscript>
|
||
|
<div class="flex-box">
|
||
|
<header role="banner" class="flex-header">
|
||
|
<nav role="navigation">
|
||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||
|
<div class="top-nav" id="navbar.top">
|
||
|
<div class="skip-nav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
|
||
|
<ul id="navbar.top.firstrow" class="nav-list" title="Navigation">
|
||
|
<li><a href="../../index.html">Overview</a></li>
|
||
|
<li><a href="package-summary.html">Package</a></li>
|
||
|
<li class="nav-bar-cell1-rev">Class</li>
|
||
|
<li><a href="package-tree.html">Tree</a></li>
|
||
|
<li><a href="../../deprecated-list.html">Deprecated</a></li>
|
||
|
<li><a href="../../index-all.html">Index</a></li>
|
||
|
<li><a href="../../help-doc.html">Help</a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="sub-nav">
|
||
|
<div>
|
||
|
<ul class="sub-nav-list">
|
||
|
<li>Summary: </li>
|
||
|
<li><a href="#nested.class.summary">Nested</a> | </li>
|
||
|
<li><a href="#field.summary">Field</a> | </li>
|
||
|
<li><a href="#constructor.summary">Constr</a> | </li>
|
||
|
<li><a href="#method.summary">Method</a></li>
|
||
|
</ul>
|
||
|
<ul class="sub-nav-list">
|
||
|
<li>Detail: </li>
|
||
|
<li><a href="#field.detail">Field</a> | </li>
|
||
|
<li><a href="#constructor.detail">Constr</a> | </li>
|
||
|
<li><a href="#method.detail">Method</a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="nav-list-search"><label for="search">SEARCH:</label>
|
||
|
<input type="text" id="search" value="search" disabled="disabled">
|
||
|
<input type="reset" id="reset" value="reset" disabled="disabled">
|
||
|
</div>
|
||
|
</div>
|
||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||
|
<span class="skip-nav" id="skip.navbar.top">
|
||
|
<!-- -->
|
||
|
</span></nav>
|
||
|
</header>
|
||
|
<div class="flex-content">
|
||
|
<main role="main">
|
||
|
<!-- ======== START OF CLASS DATA ======== -->
|
||
|
<div class="header">
|
||
|
<div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">battleship.view</a></div>
|
||
|
<h1 title="Class Window" class="title">Class Window</h1>
|
||
|
</div>
|
||
|
<div class="inheritance" title="Inheritance Tree">java.lang.Object
|
||
|
<div class="inheritance"><a href="AbstractView.html" title="class in battleship.view">battleship.view.AbstractView</a>
|
||
|
<div class="inheritance">battleship.view.Window</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<section class="description">
|
||
|
<dl class="notes">
|
||
|
<dt>All Implemented Interfaces:</dt>
|
||
|
<dd><code><a href="View.html" title="interface in battleship.view">View</a></code></dd>
|
||
|
</dl>
|
||
|
<hr>
|
||
|
<pre>public class <span class="type-name-label">Window</span>
|
||
|
extends <a href="AbstractView.html" title="class in battleship.view">AbstractView</a></pre>
|
||
|
<div class="block">Window view, instanced if argument 2 equals to "nogui"</div>
|
||
|
<dl class="notes">
|
||
|
<dt>See Also:</dt>
|
||
|
<dd><a href="View.html" title="interface in battleship.view"><code>View</code></a>,
|
||
|
<a href="AbstractView.html" title="class in battleship.view"><code>AbstractView</code></a></dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
<section class="summary">
|
||
|
<ul class="summary-list">
|
||
|
<!-- ======== NESTED CLASS SUMMARY ======== -->
|
||
|
<li>
|
||
|
<section class="nested-class-summary" id="nested.class.summary">
|
||
|
<h2>Nested Class Summary</h2>
|
||
|
<div class="member-summary">
|
||
|
<table class="summary-table">
|
||
|
<caption><span>Nested Classes</span></caption>
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th class="col-first" scope="col">Modifier and Type</th>
|
||
|
<th class="col-second" scope="col">Class</th>
|
||
|
<th class="col-last" scope="col">Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr class="alt-color">
|
||
|
<td class="col-first"><code>(package private) class </code></td>
|
||
|
<th class="col-second" scope="row"><code><span class="member-name-link"><a href="Window.Draw.html" title="class in battleship.view">Window.Draw</a></span></code></th>
|
||
|
<td class="col-last">
|
||
|
<div class="block">Panel where we paint the board</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<!-- =========== FIELD SUMMARY =========== -->
|
||
|
<li>
|
||
|
<section class="field-summary" id="field.summary">
|
||
|
<h2>Field Summary</h2>
|
||
|
<div class="member-summary">
|
||
|
<table class="summary-table">
|
||
|
<caption><span>Fields</span></caption>
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th class="col-first" scope="col">Modifier and Type</th>
|
||
|
<th class="col-second" scope="col">Field</th>
|
||
|
<th class="col-last" scope="col">Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr class="alt-color">
|
||
|
<td class="col-first"><code>(package private) javax.swing.JFrame</code></td>
|
||
|
<th class="col-second" scope="row"><code><span class="member-name-link"><a href="#frame">frame</a></span></code></th>
|
||
|
<td class="col-last"> </td>
|
||
|
</tr>
|
||
|
<tr class="row-color">
|
||
|
<td class="col-first"><code>int</code></td>
|
||
|
<th class="col-second" scope="row"><code><span class="member-name-link"><a href="#height">height</a></span></code></th>
|
||
|
<td class="col-last">
|
||
|
<div class="block">grids height, do no represent frame size</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="alt-color">
|
||
|
<td class="col-first"><code>private <a href="../control/WindowKeyboardListener.html" title="class in battleship.control">WindowKeyboardListener</a></code></td>
|
||
|
<th class="col-second" scope="row"><code><span class="member-name-link"><a href="#keyboardComponent">keyboardComponent</a></span></code></th>
|
||
|
<td class="col-last"> </td>
|
||
|
</tr>
|
||
|
<tr class="row-color">
|
||
|
<td class="col-first"><code>private <a href="../control/WindowMouseListener.html" title="class in battleship.control">WindowMouseListener</a></code></td>
|
||
|
<th class="col-second" scope="row"><code><span class="member-name-link"><a href="#mouseComponent">mouseComponent</a></span></code></th>
|
||
|
<td class="col-last"> </td>
|
||
|
</tr>
|
||
|
<tr class="alt-color">
|
||
|
<td class="col-first"><code>(package private) java.lang.String</code></td>
|
||
|
<th class="col-second" scope="row"><code><span class="member-name-link"><a href="#upperSubTitle">upperSubTitle</a></span></code></th>
|
||
|
<td class="col-last"> </td>
|
||
|
</tr>
|
||
|
<tr class="row-color">
|
||
|
<td class="col-first"><code>(package private) java.lang.String</code></td>
|
||
|
<th class="col-second" scope="row"><code><span class="member-name-link"><a href="#upperTitle">upperTitle</a></span></code></th>
|
||
|
<td class="col-last"> </td>
|
||
|
</tr>
|
||
|
<tr class="alt-color">
|
||
|
<td class="col-first"><code>int</code></td>
|
||
|
<th class="col-second" scope="row"><code><span class="member-name-link"><a href="#width">width</a></span></code></th>
|
||
|
<td class="col-last">
|
||
|
<div class="block">grids width, do no represent frame size</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="inherited-list">
|
||
|
<h3 id="fields.inherited.from.class.battleship.view.AbstractView">Fields inherited from class battleship.view.<a href="AbstractView.html" title="class in battleship.view">AbstractView</a></h3>
|
||
|
<code><a href="AbstractView.html#game">game</a></code></div>
|
||
|
<div class="inherited-list">
|
||
|
<h3 id="fields.inherited.from.class.battleship.view.View">Fields inherited from interface battleship.view.<a href="View.html" title="interface in battleship.view">View</a></h3>
|
||
|
<code><a href="View.html#shipsSize">shipsSize</a></code></div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||
|
<li>
|
||
|
<section class="constructor-summary" id="constructor.summary">
|
||
|
<h2>Constructor Summary</h2>
|
||
|
<div class="member-summary">
|
||
|
<table class="summary-table">
|
||
|
<caption><span>Constructors</span></caption>
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th class="col-first" scope="col">Constructor</th>
|
||
|
<th class="col-last" scope="col">Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr class="alt-color">
|
||
|
<th class="col-constructor-name" scope="row"><code><span class="member-name-link"><a href="#%3Cinit%3E(battleship.model.Game)">Window</a></span>​(<a href="../model/Game.html" title="class in battleship.model">Game</a> game)</code></th>
|
||
|
<td class="col-last"> </td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<!-- ========== METHOD SUMMARY =========== -->
|
||
|
<li>
|
||
|
<section class="method-summary" id="method.summary">
|
||
|
<h2>Method Summary</h2>
|
||
|
<div class="member-summary" id="method-summary-table">
|
||
|
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" id="t0" class="active-table-tab">All Methods</button><button role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t2" class="table-tab" onclick="show(2);">Instance Methods</button><button role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t4" class="table-tab" onclick="show(8);">Concrete Methods</button></div>
|
||
|
<div id="method-summary-table.tabpanel" role="tabpanel">
|
||
|
<table class="summary-table" aria-labelledby="t0">
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th class="col-first" scope="col">Modifier and Type</th>
|
||
|
<th class="col-second" scope="col">Method</th>
|
||
|
<th class="col-last" scope="col">Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr class="alt-color" id="i0">
|
||
|
<td class="col-first"><code><a href="../utils/Pair.html" title="class in battleship.utils">Pair</a><java.lang.Integer,​java.lang.Integer></code></td>
|
||
|
<th class="col-second" scope="row"><code><span class="member-name-link"><a href="#chooseMove(battleship.model.player.Player)">chooseMove</a></span>​(<a href="../model/player/Player.html" title="interface in battleship.model.player">Player</a> player)</code></th>
|
||
|
<td class="col-last">
|
||
|
<div class="block">ask player to choose a position in its opponent grid</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="row-color" id="i1">
|
||
|
<td class="col-first"><code>void</code></td>
|
||
|
<th class="col-second" scope="row"><code><span class="member-name-link"><a href="#displayBoard()">displayBoard</a></span>()</code></th>
|
||
|
<td class="col-last">
|
||
|
<div class="block">refresh windows to display updated content</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="alt-color" id="i2">
|
||
|
<td class="col-first"><code>void</code></td>
|
||
|
<th class="col-second" scope="row"><code><span class="member-name-link"><a href="#displayWinner(battleship.model.player.Player)">displayWinner</a></span>​(<a href="../model/player/Player.html" title="interface in battleship.model.player">Player</a> winner)</code></th>
|
||
|
<td class="col-last">
|
||
|
<div class="block">open a dialog to display the winner and exit the program when window is closed</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="row-color" id="i3">
|
||
|
<td class="col-first"><code>protected java.lang.String</code></td>
|
||
|
<th class="col-second" scope="row"><code><span class="member-name-link"><a href="#getKeyInput()">getKeyInput</a></span>()</code></th>
|
||
|
<td class="col-last">
|
||
|
<div class="block">ask player for keyboard input and return result</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="alt-color" id="i4">
|
||
|
<td class="col-first"><code>protected java.lang.String</code></td>
|
||
|
<th class="col-second" scope="row"><code><span class="member-name-link"><a href="#keyboardInput()">keyboardInput</a></span>()</code></th>
|
||
|
<td class="col-last">
|
||
|
<div class="block">ask <a href="../model/Game.html#currentPlayer"><code>Game.currentPlayer</code></a> for keyboard input</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="row-color" id="i5">
|
||
|
<td class="col-first"><code>protected <a href="../utils/Pair.html" title="class in battleship.utils">Pair</a><java.lang.Integer,​java.lang.Integer></code></td>
|
||
|
<th class="col-second" scope="row"><code><span class="member-name-link"><a href="#mouseInput(battleship.model.player.Player)">mouseInput</a></span>​(<a href="../model/player/Player.html" title="interface in battleship.model.player">Player</a> player)</code></th>
|
||
|
<td class="col-last">
|
||
|
<div class="block">ask <code>player</code> for mouse input</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="alt-color" id="i6">
|
||
|
<td class="col-first"><code>void</code></td>
|
||
|
<th class="col-second" scope="row"><code><span class="member-name-link"><a href="#openDialog(java.lang.String)">openDialog</a></span>​(java.lang.String message)</code></th>
|
||
|
<td class="col-last">
|
||
|
<div class="block">Open a window with <code>message</code> as content and with a "OK" button</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="row-color" id="i7">
|
||
|
<td class="col-first"><code>void</code></td>
|
||
|
<th class="col-second" scope="row"><code><span class="member-name-link"><a href="#openDialog(java.lang.String,boolean)">openDialog</a></span>​(java.lang.String message,
|
||
|
boolean exitOnClose)</code></th>
|
||
|
<td class="col-last">
|
||
|
<div class="block">Open a window with <code>message</code> as content and with a "OK" button</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="alt-color" id="i8">
|
||
|
<td class="col-first"><code>void</code></td>
|
||
|
<th class="col-second" scope="row"><code><span class="member-name-link"><a href="#setShips(battleship.model.player.Player)">setShips</a></span>​(<a href="../model/player/Player.html" title="interface in battleship.model.player">Player</a> player)</code></th>
|
||
|
<td class="col-last">
|
||
|
<div class="block">Ask <code>player</code> to set position of its ships</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="row-color" id="i9">
|
||
|
<td class="col-first"><code>protected void</code></td>
|
||
|
<th class="col-second" scope="row"><code><span class="member-name-link"><a href="#setUpperText(java.lang.String)">setUpperText</a></span>​(java.lang.String s)</code></th>
|
||
|
<td class="col-last">
|
||
|
<div class="block">Display a text above the grid</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="inherited-list">
|
||
|
<h3 id="methods.inherited.from.class.battleship.view.AbstractView">Methods inherited from class battleship.view.<a href="AbstractView.html" title="class in battleship.view">AbstractView</a></h3>
|
||
|
<code><a href="AbstractView.html#getDirectionFromChar()">getDirectionFromChar</a>, <a href="AbstractView.html#toString()">toString</a>, <a href="AbstractView.html#toString(boolean)">toString</a></code></div>
|
||
|
<div class="inherited-list">
|
||
|
<h3 id="methods.inherited.from.class.java.lang.Object">Methods inherited from class java.lang.Object</h3>
|
||
|
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></div>
|
||
|
</section>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</section>
|
||
|
<section class="details">
|
||
|
<ul class="details-list">
|
||
|
<!-- ============ FIELD DETAIL =========== -->
|
||
|
<li>
|
||
|
<section class="field-details" id="field.detail">
|
||
|
<h2>Field Details</h2>
|
||
|
<ul class="member-list">
|
||
|
<li>
|
||
|
<section class="detail" id="frame">
|
||
|
<h3>frame</h3>
|
||
|
<div class="member-signature"><span class="modifiers">final</span> <span class="return-type">javax.swing.JFrame</span> <span class="member-name">frame</span></div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li>
|
||
|
<section class="detail" id="height">
|
||
|
<h3>height</h3>
|
||
|
<div class="member-signature"><span class="modifiers">public final</span> <span class="return-type">int</span> <span class="member-name">height</span></div>
|
||
|
<div class="block">grids height, do no represent frame size</div>
|
||
|
<dl class="notes">
|
||
|
<dt>See Also:</dt>
|
||
|
<dd><a href="../../constant-values.html#battleship.view.Window.height">Constant Field Values</a></dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li>
|
||
|
<section class="detail" id="width">
|
||
|
<h3>width</h3>
|
||
|
<div class="member-signature"><span class="modifiers">public final</span> <span class="return-type">int</span> <span class="member-name">width</span></div>
|
||
|
<div class="block">grids width, do no represent frame size</div>
|
||
|
<dl class="notes">
|
||
|
<dt>See Also:</dt>
|
||
|
<dd><a href="../../constant-values.html#battleship.view.Window.width">Constant Field Values</a></dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li>
|
||
|
<section class="detail" id="mouseComponent">
|
||
|
<h3>mouseComponent</h3>
|
||
|
<div class="member-signature"><span class="modifiers">private final</span> <span class="return-type"><a href="../control/WindowMouseListener.html" title="class in battleship.control">WindowMouseListener</a></span> <span class="member-name">mouseComponent</span></div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li>
|
||
|
<section class="detail" id="keyboardComponent">
|
||
|
<h3>keyboardComponent</h3>
|
||
|
<div class="member-signature"><span class="modifiers">private final</span> <span class="return-type"><a href="../control/WindowKeyboardListener.html" title="class in battleship.control">WindowKeyboardListener</a></span> <span class="member-name">keyboardComponent</span></div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li>
|
||
|
<section class="detail" id="upperTitle">
|
||
|
<h3>upperTitle</h3>
|
||
|
<div class="member-signature"><span class="return-type">java.lang.String</span> <span class="member-name">upperTitle</span></div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li>
|
||
|
<section class="detail" id="upperSubTitle">
|
||
|
<h3>upperSubTitle</h3>
|
||
|
<div class="member-signature"><span class="return-type">java.lang.String</span> <span class="member-name">upperSubTitle</span></div>
|
||
|
</section>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</section>
|
||
|
</li>
|
||
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||
|
<li>
|
||
|
<section class="constructor-details" id="constructor.detail">
|
||
|
<h2>Constructor Details</h2>
|
||
|
<ul class="member-list">
|
||
|
<li>
|
||
|
<section class="detail" id="<init>(battleship.model.Game)">
|
||
|
<h3>Window</h3>
|
||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="member-name">Window</span>​(<span class="parameters"><a href="../model/Game.html" title="class in battleship.model">Game</a> game)</span></div>
|
||
|
</section>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</section>
|
||
|
</li>
|
||
|
<!-- ============ METHOD DETAIL ========== -->
|
||
|
<li>
|
||
|
<section class="method-details" id="method.detail">
|
||
|
<h2>Method Details</h2>
|
||
|
<ul class="member-list">
|
||
|
<li>
|
||
|
<section class="detail" id="getKeyInput()">
|
||
|
<h3>getKeyInput</h3>
|
||
|
<div class="member-signature"><span class="modifiers">protected</span> <span class="return-type">java.lang.String</span> <span class="member-name">getKeyInput</span>()
|
||
|
throws <span class="exceptions">java.lang.InterruptedException</span></div>
|
||
|
<div class="block"><span class="descfrm-type-label">Description copied from class: <code><a href="AbstractView.html#getKeyInput()">AbstractView</a></code></span></div>
|
||
|
<div class="block">ask player for keyboard input and return result</div>
|
||
|
<dl class="notes">
|
||
|
<dt>Specified by:</dt>
|
||
|
<dd><code><a href="AbstractView.html#getKeyInput()">getKeyInput</a></code> in class <code><a href="AbstractView.html" title="class in battleship.view">AbstractView</a></code></dd>
|
||
|
<dt>Returns:</dt>
|
||
|
<dd>String given by player</dd>
|
||
|
<dt>Throws:</dt>
|
||
|
<dd><code>java.lang.InterruptedException</code> - see <a href="#getKeyInput()"><code>getKeyInput()</code></a></dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li>
|
||
|
<section class="detail" id="setUpperText(java.lang.String)">
|
||
|
<h3>setUpperText</h3>
|
||
|
<div class="member-signature"><span class="modifiers">protected</span> <span class="return-type">void</span> <span class="member-name">setUpperText</span>​(<span class="parameters">java.lang.String s)</span></div>
|
||
|
<div class="block">Display a text above the grid</div>
|
||
|
<dl class="notes">
|
||
|
<dt>Specified by:</dt>
|
||
|
<dd><code><a href="AbstractView.html#setUpperText(java.lang.String)">setUpperText</a></code> in class <code><a href="AbstractView.html" title="class in battleship.view">AbstractView</a></code></dd>
|
||
|
<dt>Parameters:</dt>
|
||
|
<dd><code>s</code> - text to display</dd>
|
||
|
<dt>See Also:</dt>
|
||
|
<dd><a href="#setUpperText(java.lang.String)"><code>setUpperText(String)</code></a>,
|
||
|
<a href="Terminal.html#setUpperText(java.lang.String)"><code>Terminal.setUpperText(String)</code></a></dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li>
|
||
|
<section class="detail" id="setShips(battleship.model.player.Player)">
|
||
|
<h3>setShips</h3>
|
||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="member-name">setShips</span>​(<span class="parameters"><a href="../model/player/Player.html" title="interface in battleship.model.player">Player</a> player)</span>
|
||
|
throws <span class="exceptions">java.lang.InterruptedException</span></div>
|
||
|
<div class="block">Ask <code>player</code> to set position of its ships</div>
|
||
|
<dl class="notes">
|
||
|
<dt>Specified by:</dt>
|
||
|
<dd><code><a href="View.html#setShips(battleship.model.player.Player)">setShips</a></code> in interface <code><a href="View.html" title="interface in battleship.view">View</a></code></dd>
|
||
|
<dt>Overrides:</dt>
|
||
|
<dd><code><a href="AbstractView.html#setShips(battleship.model.player.Player)">setShips</a></code> in class <code><a href="AbstractView.html" title="class in battleship.view">AbstractView</a></code></dd>
|
||
|
<dt>Parameters:</dt>
|
||
|
<dd><code>player</code> - player we ask</dd>
|
||
|
<dt>Throws:</dt>
|
||
|
<dd><code>java.lang.InterruptedException</code> - see <a href="#mouseInput(battleship.model.player.Player)"><code>mouseInput(Player)</code></a> and <a href="AbstractView.html#getDirectionFromChar()"><code>AbstractView.getDirectionFromChar()</code></a></dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li>
|
||
|
<section class="detail" id="keyboardInput()">
|
||
|
<h3>keyboardInput</h3>
|
||
|
<div class="member-signature"><span class="modifiers">protected</span> <span class="return-type">java.lang.String</span> <span class="member-name">keyboardInput</span>()
|
||
|
throws <span class="exceptions">java.lang.InterruptedException</span></div>
|
||
|
<div class="block">ask <a href="../model/Game.html#currentPlayer"><code>Game.currentPlayer</code></a> for keyboard input</div>
|
||
|
<dl class="notes">
|
||
|
<dt>Specified by:</dt>
|
||
|
<dd><code><a href="AbstractView.html#keyboardInput()">keyboardInput</a></code> in class <code><a href="AbstractView.html" title="class in battleship.view">AbstractView</a></code></dd>
|
||
|
<dt>Returns:</dt>
|
||
|
<dd>String given by player</dd>
|
||
|
<dt>Throws:</dt>
|
||
|
<dd><code>java.lang.InterruptedException</code> - throw if this Thread is interrupted while <code>sleeping</code></dd>
|
||
|
<dt>See Also:</dt>
|
||
|
<dd><a href="#keyboardInput()"><code>keyboardInput()</code></a>,
|
||
|
<a href="Terminal.html#keyboardInput()"><code>Terminal.keyboardInput()</code></a>,
|
||
|
<a href="Terminal.html#keyboardInputInteger()"><code>Terminal.keyboardInputInteger()</code></a></dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li>
|
||
|
<section class="detail" id="mouseInput(battleship.model.player.Player)">
|
||
|
<h3>mouseInput</h3>
|
||
|
<div class="member-signature"><span class="modifiers">protected</span> <span class="return-type"><a href="../utils/Pair.html" title="class in battleship.utils">Pair</a><java.lang.Integer,​java.lang.Integer></span> <span class="member-name">mouseInput</span>​(<span class="parameters"><a href="../model/player/Player.html" title="interface in battleship.model.player">Player</a> player)</span>
|
||
|
throws <span class="exceptions">java.lang.InterruptedException</span></div>
|
||
|
<div class="block">ask <code>player</code> for mouse input</div>
|
||
|
<dl class="notes">
|
||
|
<dt>Specified by:</dt>
|
||
|
<dd><code><a href="AbstractView.html#mouseInput(battleship.model.player.Player)">mouseInput</a></code> in class <code><a href="AbstractView.html" title="class in battleship.view">AbstractView</a></code></dd>
|
||
|
<dt>Parameters:</dt>
|
||
|
<dd><code>player</code> - <a href="../model/Game.html#currentPlayer"><code>Game.currentPlayer</code></a></dd>
|
||
|
<dt>Returns:</dt>
|
||
|
<dd>coordinate of <code>player</code> opponent grid</dd>
|
||
|
<dt>Throws:</dt>
|
||
|
<dd><code>java.lang.InterruptedException</code> - throw if this Thread is interrupted while <code>sleeping</code></dd>
|
||
|
<dt>See Also:</dt>
|
||
|
<dd><a href="#mouseInput(battleship.model.player.Player)"><code>mouseInput(Player)</code></a></dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li>
|
||
|
<section class="detail" id="openDialog(java.lang.String,boolean)">
|
||
|
<h3>openDialog</h3>
|
||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="member-name">openDialog</span>​(<span class="parameters">java.lang.String message,
|
||
|
boolean exitOnClose)</span></div>
|
||
|
<div class="block">Open a window with <code>message</code> as content and with a "OK" button</div>
|
||
|
<dl class="notes">
|
||
|
<dt>Parameters:</dt>
|
||
|
<dd><code>message</code> - message to display</dd>
|
||
|
<dd><code>exitOnClose</code> - <code>true</code> if when user close this window, the program exit, <code>false</code> otherwise</dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li>
|
||
|
<section class="detail" id="openDialog(java.lang.String)">
|
||
|
<h3>openDialog</h3>
|
||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="member-name">openDialog</span>​(<span class="parameters">java.lang.String message)</span></div>
|
||
|
<div class="block">Open a window with <code>message</code> as content and with a "OK" button</div>
|
||
|
<dl class="notes">
|
||
|
<dt>Parameters:</dt>
|
||
|
<dd><code>message</code> - message to display</dd>
|
||
|
<dt>See Also:</dt>
|
||
|
<dd><a href="#openDialog(java.lang.String,boolean)"><code>openDialog(String, boolean)</code></a></dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li>
|
||
|
<section class="detail" id="displayBoard()">
|
||
|
<h3>displayBoard</h3>
|
||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="member-name">displayBoard</span>()</div>
|
||
|
<div class="block">refresh windows to display updated content</div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li>
|
||
|
<section class="detail" id="chooseMove(battleship.model.player.Player)">
|
||
|
<h3>chooseMove</h3>
|
||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="../utils/Pair.html" title="class in battleship.utils">Pair</a><java.lang.Integer,​java.lang.Integer></span> <span class="member-name">chooseMove</span>​(<span class="parameters"><a href="../model/player/Player.html" title="interface in battleship.model.player">Player</a> player)</span>
|
||
|
throws <span class="exceptions">java.lang.InterruptedException</span></div>
|
||
|
<div class="block">ask player to choose a position in its opponent grid</div>
|
||
|
<dl class="notes">
|
||
|
<dt>Specified by:</dt>
|
||
|
<dd><code><a href="View.html#chooseMove(battleship.model.player.Player)">chooseMove</a></code> in interface <code><a href="View.html" title="interface in battleship.view">View</a></code></dd>
|
||
|
<dt>Overrides:</dt>
|
||
|
<dd><code><a href="AbstractView.html#chooseMove(battleship.model.player.Player)">chooseMove</a></code> in class <code><a href="AbstractView.html" title="class in battleship.view">AbstractView</a></code></dd>
|
||
|
<dt>Parameters:</dt>
|
||
|
<dd><code>player</code> - <a href="../model/Game.html#currentPlayer"><code>Game.currentPlayer</code></a></dd>
|
||
|
<dt>Returns:</dt>
|
||
|
<dd>a couple (<a href="../utils/Pair.html" title="class in battleship.utils"><code>Pair</code></a> containing the x and y coordinate (left side store Y and right side X)</dd>
|
||
|
<dt>Throws:</dt>
|
||
|
<dd><code>java.lang.InterruptedException</code> - see <a href="#mouseInput(battleship.model.player.Player)"><code>mouseInput(Player)</code></a></dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li>
|
||
|
<section class="detail" id="displayWinner(battleship.model.player.Player)">
|
||
|
<h3>displayWinner</h3>
|
||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="member-name">displayWinner</span>​(<span class="parameters"><a href="../model/player/Player.html" title="interface in battleship.model.player">Player</a> winner)</span></div>
|
||
|
<div class="block">open a dialog to display the winner and exit the program when window is closed</div>
|
||
|
<dl class="notes">
|
||
|
<dt>Parameters:</dt>
|
||
|
<dd><code>winner</code> - the winner of the game.</dd>
|
||
|
<dt>See Also:</dt>
|
||
|
<dd><a href="#displayWinner(battleship.model.player.Player)"><code>displayWinner(Player)</code></a>,
|
||
|
<a href="Terminal.html#displayWinner(battleship.model.player.Player)"><code>Terminal.displayWinner(Player)</code></a></dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</section>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</section>
|
||
|
<!-- ========= END OF CLASS DATA ========= -->
|
||
|
</main>
|
||
|
<footer role="contentinfo">
|
||
|
<nav role="navigation">
|
||
|
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||
|
<div class="bottom-nav" id="navbar.bottom">
|
||
|
<div class="skip-nav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
|
||
|
<ul id="navbar.bottom.firstrow" class="nav-list" title="Navigation">
|
||
|
<li><a href="../../index.html">Overview</a></li>
|
||
|
<li><a href="package-summary.html">Package</a></li>
|
||
|
<li class="nav-bar-cell1-rev">Class</li>
|
||
|
<li><a href="package-tree.html">Tree</a></li>
|
||
|
<li><a href="../../deprecated-list.html">Deprecated</a></li>
|
||
|
<li><a href="../../index-all.html">Index</a></li>
|
||
|
<li><a href="../../help-doc.html">Help</a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="sub-nav">
|
||
|
<div>
|
||
|
<ul class="sub-nav-list">
|
||
|
<li>Summary: </li>
|
||
|
<li><a href="#nested.class.summary">Nested</a> | </li>
|
||
|
<li><a href="#field.summary">Field</a> | </li>
|
||
|
<li><a href="#constructor.summary">Constr</a> | </li>
|
||
|
<li><a href="#method.summary">Method</a></li>
|
||
|
</ul>
|
||
|
<ul class="sub-nav-list">
|
||
|
<li>Detail: </li>
|
||
|
<li><a href="#field.detail">Field</a> | </li>
|
||
|
<li><a href="#constructor.detail">Constr</a> | </li>
|
||
|
<li><a href="#method.detail">Method</a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||
|
<span class="skip-nav" id="skip.navbar.bottom">
|
||
|
<!-- -->
|
||
|
</span></nav>
|
||
|
</footer>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|