Ran into design problem with timelines..

This commit is contained in:
Snowyfox 2021-07-29 05:40:52 -04:00
parent 31277c7871
commit ce22349538
3 changed files with 29 additions and 10 deletions

View File

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

View File

@ -291,6 +291,8 @@ RepliesComponent extends JPanel {
int pages = 1 + ((replies.size() - 1) / 8); int pages = 1 + ((replies.size() - 1) / 8);
pageLabel.setText(pageNumber + "/" + pages); pageLabel.setText(pageNumber + "/" + pages);
prevPage.setEnabled(pageNumber > 1);
nextPage.setEnabled(pageNumber < pages);
} }
// ---%-@-%--- // ---%-@-%---

View File

@ -30,21 +30,22 @@ TimelineWindow extends JFrame {
private TimelineComponent private TimelineComponent
display; display;
// - -%- -
private static final Timeline
NULL_TIMELINE = new Timeline();
{
NULL_TIMELINE.type = TimelineType.LOCAL;
}
// ---%-@-%--- // ---%-@-%---
public void public void
setTimeline(Timeline timeline) setTimeline(Timeline timeline)
{ {
if (timeline == null)
{
timeline = new Timeline();
timeline.type = TimelineType.LOCAL;
}
assert timeline != null; assert timeline != null;
this.timeline = timeline; this.timeline = timeline;
// Here, we should request for posts for the timeline.
// And pass data to TimelineComponent.
} }
// ---%-@-%--- // ---%-@-%---
@ -93,6 +94,22 @@ TimelineComponent extends JPanel {
private final List<PostPreviewComponent> private final List<PostPreviewComponent>
postPreviews = new ArrayList<>(); postPreviews = new ArrayList<>();
// ---%-@-%---
public void
setPosts()
{
/*
* Okay, so timelines are infinite, unlike replies.
* We can ask for a finite list of post preview data,
* but we're the ones holding the pagination information?
*
* Or rather, we don't currently.. we should think out
* timeline pagination, then have TimelineWindow hold
* the data.
*/
}
// ---%-@-%--- // ---%-@-%---
TimelineComponent() TimelineComponent()