Prepared a bit for data loading.

This commit is contained in:
Snowyfox 2021-07-17 05:46:27 -04:00
parent b6e3add6cd
commit 05f09ac9f4
4 changed files with 41 additions and 11 deletions

View File

@ -11,9 +11,23 @@ import java.awt.Dimension;
class
ComposeWindow extends JFrame {
private Composition
composition;
// - -%- -
private ComposeComponent
display;
// ---%-@-%---
public void
setComposition(Composition composition)
{
assert composition != null;
this.composition = composition;
}
// ---%-@-%---
ComposeWindow()

View File

@ -16,9 +16,7 @@ JKomasto {
public
JKomasto()
{
new PostWindow().setVisible(true);
new TimelineWindow().setVisible(true);
new ComposeWindow().setVisible(true);
}
// - -%- -

View File

@ -28,6 +28,15 @@ PostWindow extends JFrame {
private RepliesComponent
repliesDisplay;
// ---%-@-%---
public void
setPost(Post post)
{
assert post != null;
this.post = post;
}
// ---%-@-%---
PostWindow()
@ -67,8 +76,8 @@ PostWindow extends JFrame {
menuBar.add(displayMenu);
setJMenuBar(menuBar);
//setContentPane(postDisplay);
setContentPane(repliesDisplay);
setContentPane(postDisplay);
//setContentPane(repliesDisplay);
}
}

View File

@ -27,6 +27,15 @@ TimelineWindow extends JFrame {
private TimelineComponent
display;
// ---%-@-%---
public void
setTimeline(Timeline timeline)
{
assert timeline != null;
this.timeline = timeline;
}
// ---%-@-%---
TimelineWindow()
@ -51,8 +60,8 @@ TimelineComponent extends JPanel {
private JLabel
pageLabel;
private final List<PreviewComponent>
previews = new ArrayList<>();
private final List<PostPreviewComponent>
postPreviews = new ArrayList<>();
// ---%-@-%---
@ -81,9 +90,9 @@ TimelineComponent extends JPanel {
constraints.insets = new Insets(4, 0, 4, 0);
for (int n = 8; n > 0; --n)
{
PreviewComponent preview = new PreviewComponent();
centre.add(preview, constraints);
previews.add(preview);
PostPreviewComponent p = new PostPreviewComponent();
centre.add(p, constraints);
postPreviews.add(p);
}
setLayout(new BorderLayout());
@ -98,7 +107,7 @@ TimelineComponent extends JPanel {
class
PreviewComponent extends JComponent {
PostPreviewComponent extends JComponent {
private JLabel
topLeft, topRight, bottom;
@ -117,7 +126,7 @@ PreviewComponent extends JComponent {
// ---%-@-%---
public
PreviewComponent()
PostPreviewComponent()
{
Font font;